![]() |
![]() |
William Grimsley |
![]()
Post
#1
|
Novice ![]() ![]() Group: Members Posts: 26 Joined: 30-May 17 From: Newton Poppleford, Devon, UK Member No.: 26,424 ![]() |
Hi there,
I have this web page and this web page. I want to style the buttons on the 1st page like the ones on the 2nd page. There's already styling on there, but when the selected graph loads, the style gets deleted. Any ideas on how I can keep the style when the graph loads? Also, on the 2nd page, I want to style the buttons so that they're clickable anywhere, not just on the text. Thanks! William This post has been edited by William Grimsley: Jun 4 2017, 04:21 AM |
![]() ![]() |
Christian J |
![]()
Post
#2
|
. ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: WDG Moderators Posts: 9,687 Joined: 10-August 06 Member No.: 7 ![]() |
You could try changing each
CODE onclick="changeGraph("temp");"> to CODE onclick="changeGraph("temp"); var picked=document.getElementsByClassName('picked'); picked[0].className=picked[0].className.replace(' picked',''); this.className+=' picked';"> on each button (you can of course move the above javascript to an external function somewhere to reduce code). The above should remove an existing "picked" CLASS and instead assign it to the clicked LI element. If you want you can give e.g. the first LI element a default "picked" CLASS in the HTML: CODE <li class="button picked" (note that "picked" must come after "button"). |
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 24th June 2024 - 02:39 PM |