How do you get Control.Modal to work?
Follow the instructions !!! on the Control.Modal Page
Posted June 18th, 2007 at 3:27am by jester
I have followed the instructions and it doesn't work. I feel something may have been missed out of the instructions so I haven't noticed it.
The instructions don't tell you what files to download and include as a script etc.. I know I've got this bit right but it's an example of something overlooked.
Is there any other set up documentation?
Posted June 18th, 2007 at 6:40am by teccus
I'll check and make sure that I've set up the repository properly, sorry if I haven't!
Because of the way a modal window functions, it needs to be a direct child of the body node on a page. So it has to copy the nodes from your div into memory, and then put them back when the modal is opened. This is why you lose your references. Use the afterOpen callback to re-attach any behaviors.
This is annoying, and may change in future releases.
Posted June 18th, 2007 at 1:15pm by ryan
That doesn't help me.. Any documentation?
Posted June 18th, 2007 at 2:08pm by teccus
I don't mean to be a pain by asking for help. This product just seems really suited to my needs and I'd really like to get it working.
Can anyone help?
Posted June 19th, 2007 at 2:33pm by teccus
Yeah I'm having the exact same issue, I've been playing with this script for months off and on trying to get it to work. I keep trying because I really like it and there isn't really anything else out there that works as nicely.
I got the Control.Textarea to work right away with no problems.
We need some help Ryan :)
Josh
Posted June 22nd, 2007 at 3:59am by joshb
Any error messages or code samples you can post online that I could look at?
Posted June 22nd, 2007 at 7:37pm by ryan
No Ryan I don't get any errors or anything, it just opens the link in a new window with nothing at all happening.
I've tested in FF IE and Opera, I just don't get anything at all.
Have you run across anything like this before? Like I said I have the Textarea running perfectly with no problems. It just acts as if there's nothing there, or maybe something is missing to get it to process.
I'm running prototype 1.50 I've taken all the Control.Modal links down cause I couldn't get it to work, but I can put it all back up if you're willing to help me out.
Thanks a bunch.
Josh
Posted June 24th, 2007 at 3:32am by joshb
Post a URL and I will help you debug it!
Posted June 24th, 2007 at 12:49pm by ryan
Great, I added everything back in.
Website Example
Every text ad you see on that page should open a modal box from both the title and url links of the ad.
Thanks.
Josh
Posted June 24th, 2007 at 7:54pm by joshb
You are using the id "modal-link" many times on the page. ids must be unique to each element. Use a class name of "modal-link" instead.
$$('.modal-link').each(function(link){new Control.Modal(link);});
Posted June 25th, 2007 at 11:27am by ryan
No Dice Ryan.
I changed everything accordingly and still get the pages opening in the parent window.
Not sure what the deal is.
Thanks for the help BTW.
Josh
Posted June 26th, 2007 at 12:13pm by joshb
I mean this as no judgement, but I don't think the problem lies in the library itself...
Posted June 26th, 2007 at 10:52pm by
Your JS syntax is incorrect (looking at the version of the page you've posted a link to, at the time of writing).
Replace this:
$$('.modal_link').each (function (link) {
new Control.Modal (link);
iframe: true,
width: 800,
height: 600
});
$$('.place').each (function (link) {
new Control.Modal (link);
iframe: true,
width: 800,
height: 600
});
With this:
$$('.modal_link').each (function (link) {
new Control.Modal(link, {
iframe: true,
width: 800,
height: 600
});
});
$$('.place').each (function (link) {
new Control.Modal(link, {
iframe: true,
width: 800,
height: 600
});
});
Posted June 27th, 2007 at 3:22am by bbodien
"It's alive, IT'S ALIVE!"
Thanks so much bbodien and Ryan both, it's working perfectly, now to play with the settings to get the opacity right and we're in business.
Thank you guys so much.
J
Posted June 27th, 2007 at 10:17am by joshb
Man I have to thank you guys again, the finished product looks tremendous!
I knew this was the piece I was missing and Ryan's work never lets you down :)
Modal Final
Thanks again.
Josh
Posted June 27th, 2007 at 12:42pm by joshb
Thanks for the compliment Josh! Looks great.
Posted June 27th, 2007 at 2:25pm by ryan
No problem, good work with the design!
Posted June 28th, 2007 at 9:48am by bbodien
Thanks bbodien for all your input on the forum too.
Posted June 28th, 2007 at 11:24am by ryan
Ryan - it's a pleasure, happy to help out with something that's so much fun to use!
Posted June 29th, 2007 at 8:50am by bbodien
Ok well now I have another issue grrrrr.
I upgraded prototype to the latest stable 1.5.1.1 and Control.Modal no longer works at all.
Is there a fix for this or am I stuck?
I really want to use this but this is starting to get ridiculous.
Thoughts?
J
Posted June 30th, 2007 at 12:16pm by joshb
Josh, it does work for the vast majority of people who use it, but no doubt it is frustrating. When you post questions to the board, post as much info as you can, URLs, error messages, what browser you were using, your rising sign, what phase the moon is in, etc.
Seriously though, the more info the better. It is impossible to improve the library if I don't know what is going on. Hope we can help you!
Posted July 1st, 2007 at 8:34pm by ryan
LOL Right on!
I have exactly the same situation as before - everything opens in a new window, no error messages etc.
I created a work around using php for the specific page that uses the modals to load the 1.5.0 version of Prototype, but that seems silly to me.
Do you have any idea what changed in 1.5.1.1 that would stop the library from working, I can't be the only one that's effected by this? It would effect anyone who upgraded to 1.5.1.1. Strangely the TextArea script seems uneffected, which is great.
I'm not sure where you want me to look Ryan, I click the modal link - a blank window opens to the url - nothing more to tell.
Gimme a hint on what you need and I'll be happy to oblige.
Josh :)
Posted July 2nd, 2007 at 3:58am by joshb
Josh,
Can you put up a page that shows the problematic behaviour, then we can look.
On your modal page you're importing 1.5.0, so it's a bit tricky to see what's going wrong, as it's working fine.
Posted July 2nd, 2007 at 9:16am by bbodien
Josh, please post URLs!
I'm curious if it's a Prototype 1.5.0 versus 1.5.1 issue. In any other project I think it would have been a jump to 1.6. I haven't had any problems, and the site does run 1.5.1.
Posted July 2nd, 2007 at 11:10am by ryan
I'm not new to web developing at all, but I can't get Control.Modal to work.
Does anyone have a link to a step by step tutorial on how to get it working?
Posted June 17th, 2007 at 3:28pm by teccus