Do you know when you "wave" your cursor over a photo or a url link and it appears as I would like to put it "clickable" or the cursor changes into a "hand". My issue is this, on my site I have a photo that I've changed the source code to and the photo is
actually "clickable" but if you "wave" your cursor over the photo it dosen't appear "clickable" Does anyone know how I would fix that ? The source code is below.
See if the above works for you. I have confirmed that the cursor appears. I do not have the implementation for your makeUrl.. Check it out and let me know how it goes
Jeev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
// Add javascript to change the styles or you can do this
// in your code behind.
var arrImages = document.getElementsByTagName("img");
for(var i = 0; i < arrImages.length; i++)
{
arrImages[i].style.cursor = 'hand';
arrImages[i].onmouseover = function() {
this.style.background = '#333333';
}
arrImages[i].onmouseout = function() {
this.style.background = '#ffffff';
}
}
You can append the attributes to the Image objects via code behind by:
Image1.Attributes.Add("onmouseover","this.style.background = '#000'");
Image1.Attributes.Add("onmouseout","this.style.background = '#eee'");
Image1.Attributes.Add("style","cursor:hand;");
if you have a lot of images and they are being dynamically created, you can create
a "Wrapper Object" by placing a if they are equal to typeof(Image), then add the controls like above.
of course that javascript code would have made every image look clickable. It would take some minor adjustments on your end to make it fit to your page.
For instance, if the images are all within a div tag like so...
<div id="wrapperImages"> (my images) </div>
then you would do...
document.getElementById("wrapperImags").getElementsByTagName("img") instead of document.getElementsByTagName("img")
Thanks for replying. The above code is working but I need to pass the keyphrase / keyword into the affiliate url address so I know which keywords convert and which keywords don't convert. Will the above code all me to figure that out ?
SCM.. which code are you using .Is it the code snippet I posted?
Not exactly sure how you pick and choose the keywords to pass.If its a part of the URL, the change the navigateurl of the hyperlink and add the extra querystring values.
Jeev
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
but the most important factor of my url link is to pass along the keywords that convert and make sales for me and I need to track that information through my link, perhaps with a subid_parameter value ? Would anyone know how to apend
that to my url ? What querystring values would I need ?
Thanks for the response. Your code is working fine now. I thank you for that, for helping me. Jeev, would you or anyone know how to "write" what a person says on the page ? Meaning if I get ppc traffic for one of my sites and that person types in "American
Dating Sites" is there anyway for me to have "Amercian Dating Sites" at the top of the page ? without having me make that page dynamically ?
Member
3 Points
102 Posts
How to make photos "appear clickable" ?
Dec 21, 2007 10:41 AM|scm22ri|LINK
Hi Everyone,
(I apologize for my terrible terminology)
Do you know when you "wave" your cursor over a photo or a url link and it appears as I would like to put it "clickable" or the cursor changes into a "hand". My issue is this, on my site I have a photo that I've changed the source code to and the photo is actually "clickable" but if you "wave" your cursor over the photo it dosen't appear "clickable" Does anyone know how I would fix that ? The source code is below.
<
asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/Ringtone-Carrier-Photos/alltel-Complimentary Ringtones.jpg" onClick="makeUrl('http://fbgdc.com/click/?s=8785&c=53726&subid=yahoo=flycell=alltel')" Target="_blank">Alltell 15 Complimentary Ringtones</asp:HyperLink></td>http://tinyurl.com/2tca8w (This is the page, just "wave" your cursor over the "alltell photo" and you will know what I'm talking about.)
Thanks everyone for there help.
Contributor
5041 Points
1830 Posts
Re: How to make photos "appear clickable" ?
Dec 21, 2007 11:14 AM|christiandev|LINK
you need to use a css style, style="cursor:hand"
Regards, Christiandev (@chrisdev80), MCPD Web (2 & 4) & MCTS Windows (www.ScoreDonkey.com)
Member
300 Points
89 Posts
Re: How to make photos "appear clickable" ?
Dec 21, 2007 11:20 AM|KoenSt|LINK
That's because you're using the OnClick event with JavaScript behind it instead of the href property in your HyperLink.
Is there a specific reason why you're using JavaScript to create the actal link?
That way future readers will know which post solved your issue.
Participant
1480 Points
352 Posts
Re: How to make photos "appear clickable" ?
Dec 21, 2007 11:21 AM|aadreja|LINK
try this
<asp:HyperLink ID="HyperLink1" runat="server" onmouseover="javascript:this.style.cursor='hand'" onmouseout="javascript:this.style.cursor='pointer'" ImageUrl="~/Ringtone-Carrier-Photos/alltel-Complimentary Ringtones.jpg"
onClick="makeUrl('http://fbgdc.com/click/?s=8785&c=53726&subid=yahoo=flycell=alltel')"
Target="_blank">Alltell 15 Complimentary Ringtones</asp:HyperLink>
Ritesh
---------------------------------------------
Please do not forget to mark as Answer if my reply is helpful.
Member
356 Points
114 Posts
Re: How to make photos "appear clickable" ?
Dec 21, 2007 01:37 PM|JustinHolton|LINK
Member
361 Points
101 Posts
Re: How to make photos "appear clickable" ?
Dec 21, 2007 08:22 PM|cafeasp|LINK
quick question: why does visual studio says attribute not valid ?
Thanks
All-Star
16800 Points
3695 Posts
Re: How to make photos "appear clickable" ?
Dec 21, 2007 09:01 PM|Jeev|LINK
Because the asp.net hyperlink has no such attribute. If you need to add an attribute use this in the code behind page
link.Attributes.Add("onmouseover"," javascript:......")
link is the assumed id
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
Member
35 Points
133 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 01:21 AM|ArunTyagi|LINK
<
asp:HyperLink ID="HyperLink1" runat="server" ImageUrl="~/img/justAdded_thumb_sample.jpg" NavigateUrl="~/Default2.aspx">HyperLink</asp:HyperLink>To Make a Click Able You Have to give the Navigate Url .....
Member
341 Points
159 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 02:45 AM|sandeepthekka|LINK
Member
3 Points
102 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 04:29 PM|scm22ri|LINK
Hi,
Thanks for the replys everyone. I've tried all of the belo code and nothing seems to be working.
"That's because you're using the OnClick event with JavaScript behind it instead of the href property in your HyperLink.
Is there a specific reason why you're using JavaScript to create the actal link?"
I need to use the Javascript because I need to track my affiliate sales and which keywords convert and which ones don't convert.
Please advise.
Thanks
All-Star
16800 Points
3695 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 05:54 PM|Jeev|LINK
See if the above works for you. I have confirmed that the cursor appears. I do not have the implementation for your makeUrl.. Check it out and let me know how it goes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
Member
361 Points
101 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 07:29 PM|cafeasp|LINK
Thanks
All-Star
16800 Points
3695 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 07:37 PM|Jeev|LINK
Did it work as you intended?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
Contributor
2255 Points
1022 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 10:00 PM|triggered|LINK
In addition to changing the cursor to "hand", changing the colors of the borders makes it appear clickable as well.
for instance,
<asp:Image ID="iMyImage" runat="server" ... ></asp:Image>
Member
169 Points
277 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 08:56 AM|lahorya|LINK
Hi Triggered,
Can you provide full code for this java script in code behind. thanks in advance.
Member
207 Points
156 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 09:06 AM|koolprogrammer|LINK
@ triggered
wont that change the attribute of every image in the page including banners logos and other images which are not links at all???
Contributor
2255 Points
1022 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 01:22 PM|triggered|LINK
You can append the attributes to the Image objects via code behind by:
Contributor
2255 Points
1022 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 01:26 PM|triggered|LINK
of course that javascript code would have made every image look clickable. It would take some minor adjustments on your end to make it fit to your page.
For instance, if the images are all within a div tag like so...
<div id="wrapperImages"> (my images) </div>
then you would do...
document.getElementById("wrapperImags").getElementsByTagName("img") instead of document.getElementsByTagName("img")
Member
3 Points
102 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 04:39 PM|scm22ri|LINK
Hi Jeev and everyone.
Thanks for replying. The above code is working but I need to pass the keyphrase / keyword into the affiliate url address so I know which keywords convert and which keywords don't convert. Will the above code all me to figure that out ?
http://tinyurl.com/2tca8w
Thanks again everyone.
All-Star
16800 Points
3695 Posts
Re: How to make photos "appear clickable" ?
Dec 25, 2007 12:09 AM|Jeev|LINK
SCM.. which code are you using .Is it the code snippet I posted?
Not exactly sure how you pick and choose the keywords to pass.If its a part of the URL, the change the navigateurl of the hyperlink and add the extra querystring values.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
Member
3 Points
102 Posts
Re: How to make photos "appear clickable" ?
Dec 25, 2007 07:59 PM|scm22ri|LINK
Hi Jeev,
Thanks for the reply.
I'm using this code
<asp:HyperLink ImageUrl="alltel-ComplimentaryRingtones.jpg" runat="server" ID="hlink" NavigateUrl="javascript:makeUrl('http://fbgdc.com/click/?s=8785&c=53726&subid=yahoo=flycell=alltel');" />
(I'm promoting my site via ppc marketing)
but the most important factor of my url link is to pass along the keywords that convert and make sales for me and I need to track that information through my link, perhaps with a subid_parameter value ? Would anyone know how to apend that to my url ? What querystring values would I need ?
Thanks
All-Star
16800 Points
3695 Posts
Re: How to make photos "appear clickable" ?
Dec 26, 2007 07:33 AM|Jeev|LINK
Hi Scm,
well not sure of exactly how the logic for PPC would work but changing the navigateurl should be a piece of cake
To add a new query string that is a static value add it to the url you already have inside the makeurl method.
If its a dynamic value, then instead of assigning the Navigateurl in the aspx page, you can do the same in your code behind page..
Hope it helps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
Member
3 Points
102 Posts
Re: How to make photos "appear clickable" ?
Dec 26, 2007 01:58 PM|scm22ri|LINK
Hi Jeev,
Thanks for the response. Your code is working fine now. I thank you for that, for helping me. Jeev, would you or anyone know how to "write" what a person says on the page ? Meaning if I get ppc traffic for one of my sites and that person types in "American Dating Sites" is there anyway for me to have "Amercian Dating Sites" at the top of the page ? without having me make that page dynamically ?
Thanks