Focal Point
Background color on hyperlink

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/8477092236

July 18, 2013, 12:06 PM
CathyB
Background color on hyperlink
Hi,

I have a HTML page with 4 hyperlinks - setup to look like buttons. When any of the 4 links is clicked they will load into the the frame of this HTML page. What I would like is have the background color change when they click on one of the buttons (Hyperlinks). which I've been able to do with using "active" however, if the user click anywhere on the loaded new HTML page the background color of the button disappears. do I need some short of onmousedown function to maintain the background color? If anyone has an example or can direct me to some some additional information on this that would be great.


WEBFOCUS 7.14
WEBFOCUS.8.04
July 18, 2013, 01:31 PM
Francis Mariani
You'll have to use JavaScript to manipulate this. Take a look at StackOverflow: How to keep :active css style after clicking an element, particularly the third answer. You will have to deal with the scenario of un-highlighting a hyperlink when a second one is clicked on...


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
July 18, 2013, 02:11 PM
CathyB
Thanks Francis that works great. But I do need it to un-highlight when the next one is selected....any insight??


WEBFOCUS 7.14
WEBFOCUS.8.04
July 18, 2013, 02:19 PM
Francis Mariani
If you're using JavaScript, the quickest method would be to remove the background colour of each of the four hyperlinks, then apply the background colour on the clicked-on hyperlink.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server