JQuery Adjust
- Started
- Last post
- 27 Responses
- Dancer
I have had a quick request from a client who wants to load a competition pop up on the front page. I was going to use something similar to Lightbox and landed at Lightwindow.
Now I have NO experience with JQuery as some of you may know.
2 things I need help with:
• All I need to do though is get this button to trigger when the WIndow loads (instead of clicking it).
• Make the image a Link to the competition.http://www.adance.co.uk/dump/lig…
Simple enough but I have played around enough to completely blow the budget already.
Thanks
- kalkal0
Also, as far as I see, Lightwindow is based on prototype, not jQuery?..
- Dancer0
Sorry yeah, you're right. My Bad.
It's all fancy Javascript though right?
- kalkal0
Well I would say its
<body onload="initialize();">
Based on this bit
},
//
// Initialize the lightwindow.
//
initialize : function(options) {Which is the trigger script but I don't see how to declare which link you want to trigger.
- Dancer0
Ok.
A bit beyond me... may try a different Method.
Thanks
- Daithi0
colorbox does this I think
- Daithi0
http://colorpowered.com/colorbox…
Yup:
open false
If true, the lightbox will automatically open with no input from the visitor.
- Dancer0
Thanks... well I think I put it in right but Still doesn't work. Thanks for your effort though Kalkal
- neverblink0
you can do clicks with jQuery...
so on your lightwindow page, you could just do
$(window).load(function(){
$('a.lightwindow').click();
}
- Dancer0
nb,
Do you mean, within lightwindow.js?(sorry just got in)
- Dancer0
Also I want it to do it onload not onClick
- neverblink0
Just create a new script tag at the end of your head.
Put in what I wrote above.
The script will 'fake' a click on the link to open the lightwindow once the page has loaded.
- Dancer0
no dice. thanks for the suggestion though
- neverblink0
hmm.. should work..
*checks your sourcecode
Ah! you're using prototype not jQuery in that first example you posted! Yeah, that won't work then.
- Dancer0
hehe. Yeah I got that part wrong...
It's amazing how I think the simplest things take all day.
- neverblink0
How about you remove that 'false' from the observe() somewhere at the end of lightwindow.js ? It looks like it's already doing what you want, but that false is stopping it..
- Dancer0
Nope.
I tried to implement what Kalkal & Acescence posted up there ^ http://www.datawinconsulting.com…I can get this to work sort of.
Link now changed:
http://www.adance.co.uk/dump/lig…
- Dancer0
So I guess this is a sort of fix but I am unsure how to centre the box no matter what the size of the browser is ...
Thanks for you help as always QBN
:)