473,322 Members | 1,425 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Getting Lightbox js to work with existing js include

Hello, I have limited understanding of js (css/html is more me) and
when I run into complicated problems I am left undone. The person I
normally call upon is on holiday so I was wondering if I could present
it here for an answer.

The page in question is http://www.sunraycomfort.com.au/p-inslab.html
(and will be applied to all other product pages)
I am using the lightbox js (from http://huddletogether.com/projects/lightbox/)
which is here:
http://www.sunraycomfort.com.au/lightbox/lightbox.js
and I am using my own (well actually Dreamweaver's) _basic_ mash of
functions that sort of get me by most of the time :) and can be viewed
here:
http://www.sunraycomfort.com.au/default.js

Essentially the issue is in the onLoad event being required/fired
twice. Once by Lightbox:
---------------------------------------------
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function'){
window.onload = func;
} else {
window.onload = function(){
oldonload();
func();
}
}

}

addLoadEvent(initLightbox); // run initLightbox onLoad
---------------------------------------------

And then again by the default.js:
---------------------------------------------
function runIt(){
MM_preloadImages(
...snip...
);
}

which appears as an onLoad event in the body tag of the HTML.
--------------------------------------------

With it all as it is, the image enlargement doesn't work in the
lightbox, however, if I take the onLoad event off the body tag then it
works...
How do I get them to work together?
I have removed the onLoad event from the following page so you can see
the Lightbox working:
http://www.sunraycomfort.com.au/p-undertile.html

Thanks for any help!
daniel

Aug 23 '07 #1
1 1839
Peter Michaux said the following on 8/23/2007 5:29 PM:
On Aug 23, 2:13 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
>Peter Michaux wrote:
<snip>
>>An obsession with backwards compatibility can result in lost profit.
True. But a disregardment of that will result in an even greater loss.

A complete disregard may result in a greater loss.
Peter, never argue with an idiot, they will drag you down to there level
and defeat you with experience.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: NoWhereMan | last post by:
Hi everybody, first of all, let me say I'm not really a javascript (more a php) guy. Now, I'm trying to integrate lightbox V1 into my project http://flatpress.sf.net I chose V1 because it...
1
by: bordagen | last post by:
Hi all, Is it possible to print the current active image only using Lightbox, without printing the rest of the page content? Cheers
3
by: Bouzy | last post by:
I have been trying to put lightbox on my site I am making, but its not working. I have searched on forums and can't find exactly the same problem. When I click on my thumnail to open it abosolutly...
1
by: metaphysics | last post by:
I'm attempting to create a slideshow with similar functionality as Lightbox 2. I don't want anything to pop up like the Lightbox does, I just want the slideshow to have next/previous buttons (like...
185
by: jacob navia | last post by:
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will...
8
by: vanald04 | last post by:
Alright, I racked my brain all last night and can't figure out what I'm doing wrong. I've copied: <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript"...
2
by: jrod11 | last post by:
I recently found a gallery (http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6727&lngWId=4). The image in the gallery when clicked on will open the larger image in the same...
9
Catalyst159
by: Catalyst159 | last post by:
I have a form which is used to calculate residential Floor Area Ratio (FAR). The form is structured into seven parts as follows: Part A: Maximum FAR and Floor Area: Part B: Gross Floor Area of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.