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.
Marked as answer by Vince Xu - MSFT on Dec 27, 2007 09:21 AM
// 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';
}
}
Marked as answer by Vince Xu - MSFT on Dec 27, 2007 09:20 AM
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.
Jeev
All-Star
24182 Points
3719 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 09:54 PM|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.
cafeasp
Member
559 Points
103 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 11:29 PM|LINK
Thanks
Jeev
All-Star
24182 Points
3719 Posts
Re: How to make photos "appear clickable" ?
Dec 22, 2007 11:37 PM|LINK
Did it work as you intended?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you get the answer to your question, please mark it as the answer.
triggered
Contributor
3356 Points
908 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 02:00 AM|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>
// 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'; } }lahorya
Member
267 Points
263 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 12:56 PM|LINK
Hi Triggered,
Can you provide full code for this java script in code behind. thanks in advance.
koolprogramm...
Member
328 Points
160 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 01:06 PM|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???
triggered
Contributor
3356 Points
908 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 05:22 PM|LINK
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.triggered
Contributor
3356 Points
908 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 05:26 PM|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")
scm22ri
Member
3 Points
105 Posts
Re: How to make photos "appear clickable" ?
Dec 23, 2007 08:39 PM|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.
Jeev
All-Star
24182 Points
3719 Posts
Re: How to make photos "appear clickable" ?
Dec 25, 2007 04:09 AM|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.