Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

How to change button color after page load

$
0
0

Hi,

I have created A,B AND C buttons on three web part pages a, b and c in sharepoint 2010. I can see A,B,C buttons on all three web part pages(a,b,c). If I click button A, it loads page a.
If I click button B, it loads page b.

I tried to highlight button B on page b and button C on page c and button A on page a using jquery but I couldn't get it.

Can any body help me out to resolve the issue?

Any help would be appreciated.

Here is my script and let me know if any changes are required.

<style class="ms-rteThemeForeColor-1-0 ms-rteFontSize-1" type="text/css">
.BOSSReports {
 BACKGROUND-COLOR: blue; FONT-WEIGHT: normal
}
#DailyReports {
 BACKGROUND-COLOR: yellow
}
#RangeReports {
 BACKGROUND-COLOR: yellow
}
#AdminScreen {
 BACKGROUND-COLOR: yellow
}<script class="ms-rteThemeForeColor-1-0 ms-rteFontSize-1" type="text/javascript">

var buttontarget=""

function change(e, color){
var el=window.event? event.srcElement: e.target
if (el.tagName=="INPUT"&&el.type=="button")
el.style.backgroundColor=color
}

function jumpto2(url){
if (buttontarget=="")
window.location=url
else if (buttontarget=="_new")
window.open(url)
else
parent[buttontarget].location=url
}</script>&#160;<input class="BOSSReports ms-rteThemeForeColor-1-0 ms-rteFontSize-1" id="DailyReports" onmouseover="change(event, &#39;da2128&#39;)" onmouseout="change(event, &#39;59595a&#39;)" onclick="jumpto2(&#39;/Pages/BOSSReports.aspx&#39;)" type="button" value="DailyReports" style="background-color: #59595a"/><input class="BOSSReports ms-rteThemeForeColor-1-0 ms-rteFontSize-1" id="RangeReports" onmouseover="change(event, &#39;da2128&#39;)" onmouseout="change(event, &#39;59595a&#39;)" onclick="jumpto2(&#39;/Pages/RangeReports.aspx&#39;)" type="button" value="RangeReports" style="background-color: #59595a"/><input class="BOSSReports ms-rteThemeForeColor-1-0 ms-rteFontSize-1" id="AdminScreen" onmouseover="change(event, &#39;da2128&#39;)" onmouseout="change(event, &#39;59595a&#39;)" onclick="jumpto2(&#39;/Pages/AdminScreen.aspx&#39;)" type="button" value="AdminScreen" style="background-color: #59595a"/>


AA.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>