Opening a different url for each image in a javascript slide show

John Carney
John Carney used Ask the Experts™
on
Is it possible to have a different onclick event for each of the images in the code below? Please let me know if you need to see the javascript to answer the question. Here's the web page in question: http://excelitup.com

Thnaks,

John
<ul class="mainGraphic" onclick="MM_openBrWindow('PhotoGallery1_beta1.html','','width=940,height= 720')">
            	<li><img src="images/RHBDetail.png" /></li>
		<li><img src="images/BrokerFormDetail.png" /></li>
</ul>

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
yes it is possible.  You can either change the code you have above to this:

<ul class="mainGraphic" >
                  <li ><img src="images/RHBDetail.png" onclick="MM_openBrWindow('PhotoGallery1_beta1.html','','width=940,height=

720')"/></li>
            <li><img src="images/BrokerFormDetail.png" onclick="MM_openBrWindow('PhotoGallery1_beta1.html','','width=940,height=

720')"/></li>
</ul>

making sure that with each image you change the html page it is pointing to or you can more simply do this:

<ul class="mainGraphic" >
<li><a href="page1.html><img src=""></a></li>
<li><a href="page2.html><img src=""></a></li>
</ul>


John CarneyReliability Business Tools Analyst II

Author

Commented:
I tried the first one and nothing happened. I tried the second one and the images didn't show up at all. I must be doing something wrong. Please take a look at the source code to the web page, and let me know if there's some reason it's not working for me. If you have the time to try it out yourself, you can download the js here: http://www.discretedata.com/scripts/jquery.innerfade.js

Thanks,

John
are you talking about in the bar on the left?  the images show up here
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

John CarneyReliability Business Tools Analyst II

Author

Commented:
Yes the two rotating images on the left. They show up properly as it is now, but not when I implement your second suggestion. Nothing happens (i.e., no url or window shows up when I click on the images.
John CarneyReliability Business Tools Analyst II

Author

Commented:
Wow, I owe you an apology. I finally slowed myself down enough to figure out why they weren't working, and now I see that they both work great.

Thanks!

John
John CarneyReliability Business Tools Analyst II

Author

Commented:
Thanks again, and please accept my apology for not getting it right out of the box.

- John
LOL.. been there myself.  Glad I could help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial