Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-08-2012, 04:02 AM   PM User | #1
bennett
New to the CF scene

 
Join Date: Jun 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
bennett is an unknown quantity at this point
Smile Using Rollover Image Swap On Image Viewed Within Lightbox

I am only a few months into learning code. Here's my dilemma.

SITUATION:

I am using lightbox so when you click on an image (col1.jpg), it takes you into lightbox, opening another image (color1.jpg), and when you click next it takes you to the next image (color2.jpg). I want to make it so that when you rollover the image (color1.jpg) while in "lightbox mode" it will show another image.

Underneath col1.jpg is a word link (color), which takes you to the same series.

PROBLEM:

I think HTML rollovers won't work, because of the javascript already present in the file.

CODE:

<div class="image">
<a href="color1.jpg" rel="lightbox[colorsequence]"><img id="col1" class="all-four-rounded-corners" src="col1.jpg" alt="col1"/></a>
<a class="hidden" href="color2.jpg" rel="lightbox[colorsequence]">image #2</a>
<p><a href="color1.jpg" rel="lightbox[colorsequence2]">color</a></p>
<a class="hidden" href="color2.jpg" rel="lightbox[typesequence2]">image #2</a>
</div>

I KNOW THAT:

Mouseovers can work like this (and other ways, too):

<img src="image1.jpg" onmouseover="this.src='image2.jpg'" onmouseout="this.src='image1.jpg'">

BUT:

Should I use javascript instead?
What code do I want to use, and where do I put it?
Should I edit some of the javascript in my lightbox files?
bennett is offline   Reply With Quote
Reply

Bookmarks

Tags
image, javascript, lightbox, rollover, swap

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:37 PM.


Advertisement
Log in to turn off these ads.