I am an absoulte beginner and been asked to amend a piece of code.
Basically we have a label and I need to make the label have different text depending on the text its over so if its over hyperlink 1 then the label will say "this is hyperlink 1 - it does blah blah blah blah", if it hovers over hyperlink 2 then it says "this
is hyperlink 2 I am different to hyperlink one"
I thought I could set variables to the hyperlinks and have the label say whatever the variable says and remove it once the hovered over... it seems more complicated than that, and people are asynig javascript (never used), dont use asp(never used)..
I have no idea where to start, and really want to impress, any guidence will be useful, if it is Javascript how do I even reference javascript (Ive never used any of this stuff before :( )
Additionally, I understand this has been written poorly (others have told me), unfortunately until we move into sharepoint next year, we have to keep it so this is meant to be an interim solution.... THANK YOU! :)
Spurs986
0 Points
2 Posts
Adding hover over label which dynamically changes when hovering over hyperlinks
Dec 12, 2012 04:20 PM|LINK
Hi
I am an absoulte beginner and been asked to amend a piece of code.
Basically we have a label and I need to make the label have different text depending on the text its over so if its over hyperlink 1 then the label will say "this is hyperlink 1 - it does blah blah blah blah", if it hovers over hyperlink 2 then it says "this is hyperlink 2 I am different to hyperlink one"
I thought I could set variables to the hyperlinks and have the label say whatever the variable says and remove it once the hovered over... it seems more complicated than that, and people are asynig javascript (never used), dont use asp(never used)..
all I have is this (sample code)
The Label:
[Code]
<asp:Label id="tb_001"
style="Z-INDEX: 104; LEFT: 9px; POSITION: absolute; TOP: 552px; width: 901px; height: 72px; right: 463px;"
runat="server" Font-Size="SMALL" Font-Names="Arial"
ForeColor="BLACK" BackColor="White">DUMMY TEXT</asp:Label>
[/Code]
AND THEN ten links like this
[Code]
<asp:HyperLink ID="Hyp_029" runat="server" Style="z-index: 128; left: 400px; position: absolute; top: 320px" Font-Names="Microsoft Sans Serif" Font-Size="Smaller" ForeColor="PowderBlue" Height="24px" NavigateUrl="<URL>"><LABEL></asp:HyperLink>
[/Code]
I have no idea where to start, and really want to impress, any guidence will be useful, if it is Javascript how do I even reference javascript (Ive never used any of this stuff before :( )
I only use SQL and to a lesser extent VBA :/
Many Thanks
Nick
Spurs986
0 Points
2 Posts
Re: Adding hover over label which dynamically changes when hovering over hyperlinks
Dec 12, 2012 04:21 PM|LINK
Additionally, I understand this has been written poorly (others have told me), unfortunately until we move into sharepoint next year, we have to keep it so this is meant to be an interim solution.... THANK YOU! :)
coder_s_a
Member
59 Points
39 Posts
Re: Adding hover over label which dynamically changes when hovering over hyperlinks
Dec 12, 2012 10:47 PM|LINK
why don't you use tootip for the hyperlink?
coder_s_a
Member
59 Points
39 Posts
Re: Adding hover over label which dynamically changes when hovering over hyperlinks
Dec 12, 2012 11:52 PM|LINK
you can use jquery for this as well...
something like this
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('p').hide(); $('a#MainContent_showHyperlink').mouseover(function () { $('p').text($('a#MainContent_showHyperlink').text()); $('p').show(); }); $('a').mouseout(function () { $('p').hide(); }); }); </script> <asp:HyperLink runat="server" ID="showHyperlink" Text="Hyperlink1"></asp:HyperLink> <p></p>