Go Back   Dynamic Drive Forums > DD Scripts > Dynamic Drive scripts help
Search Dynamic Drive Forums:

Reply
 
Thread Tools Search this Thread
  #1  
Old 08-07-2008, 09:02 AM
frank95a frank95a is offline
New Comer (less than 5 posts)
 
Join Date: Aug 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Lightbox Help Onmouseover

1) Script Title: Lightbox V 2.0.4

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...box2/index.htm

3) Describe problem: Simply put, is there anyway to have the image viewer window open onmouseover rather than onclick? If I use rel="lightbox" , then I have to click on the image for the viewer to open. I would rather need the image to open onmouseover

Thanks in advance
Reply With Quote
  #2  
Old 08-07-2008, 01:35 PM
rangana's Avatar
rangana rangana is offline
Elite Coders
 
Join Date: Feb 2008
Location: Cebu City Philippines
Posts: 1,115
Thanks: 17
Thanked 267 Times in 265 Posts
Default

Go to lightbox.js. Find this part (found in lightbox.prototype):
Code:
Lightbox.prototype = {
	
	// initialize()
	// Constructor runs on completion of the DOM loading. Loops through anchor tags looking for 
	// 'lightbox' references and applies onclick events to appropriate links. The 2nd section of
	// the function inserts html at the bottom of the page which is used to display the shadow 
	// overlay and the image container.
	//
	initialize: function() {	
		if (!document.getElementsByTagName){ return; }
		var anchors = document.getElementsByTagName('a');
		var areas = document.getElementsByTagName('area');

		// loop through all anchor tags
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			
			var relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){
				anchor.onclick = function () {myLightbox.start(this); return false;}
			}
		}
Change highlighted with onmouseover instead and see if that helps.
Reply With Quote
The Following User Says Thank You to rangana For This Useful Post:
frank95a (08-12-2008)
  #3  
Old 08-07-2008, 04:11 PM
frank95a frank95a is offline
New Comer (less than 5 posts)
 
Join Date: Aug 2008
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks so much... It worked like a charm
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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. The time now is 01:02 AM.

Home - Contact Us - Archives - Link to DD - Top 

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.