multiple links on one page

Whenever I have more than one iframe link or lightbox link on a page the first link works correctly but the second link does not. The second link still opens a window or loads an image but it opens a whole new browser window instead of the nice little box as intended. I used the page code from this site to test and the same thing happens. Any suggestions?

Posted May 18th, 2007 at 8:46pm by kenbusby

I had the some problem. Im not sure what the proper terminology is for this but you need to change the link id modallink**** to have a unique value. Mayber someone can explain this a little better than me.

modallink1 modallink2 modallink3

and so forth.

Posted May 21st, 2007 at 10:30pm by SACSTAR

Thanks, I'll give it a try.

Posted May 23rd, 2007 at 1:39pm by kenbusby

Correct. The web standards define that you can only have one object with a particular ID on a page. Javascript typically targets elements by their IDs, so if you break the rule and have elements sharing IDs, only the first element with the ID will be picked up, as you have found.

Posted May 25th, 2007 at 5:21am by bbodien

I am having a similar problem.

I have links to multiple iframes, all with unique IDs, yet the first two on the page will always display, but the other ones will pop up full screen rather than in the overlay window.

I am using a custom iframe template for each.


    Event.observe(window,'load',function(){
        new Control.Modal($('requestfriend'),
        {
            iframe: true,
            iframeTemplate: new Template(''),
            width: 750,
            height: 400
        }
        );
        new Control.Modal($('share'),
        {
            iframe: true,
            iframeTemplate: new Template(''),
            width: 750,
            height: 400
        }
        );
        new Control.Modal($('setgoals'),
        {
            iframe: true,
            iframeTemplate: new Template(''),
            width: 750,
            height: 500
        }
        );
        new Control.Modal($('takequiz'),
        {
            iframe: true,
            iframeTemplate: new Template(''),
            width: 815,
            height: 550
        }
        );
        new Control.Modal($('nickelbag'),
        {
            iframe: true,
            iframeTemplate: new Template(''),
            width: 815,
            height: 550
        }
        );
    });
     function addCloseLink() { 
        new Insertion.Bottom('modal_container', "

close

"); } function test(){ var current_modal = Control.Modal.current; current_modal.close(); }

Posted June 14th, 2007 at 10:40am by mrbaseball9

??????????Event.observe(window,'load',function(){??????????????????????????????????????????new Control.Modal($('requestfriend'),?????????????????{?????????????????????????iframe: true,?????????????????????????iframeTemplate: new Template(''),?????????????????????????width: 750,?????????????????????????height: 400??????????????????????????????????????????}?????????????????);??????????????????????????????????new Control.Modal($('share'),?????????????????{?????????????????????????iframe: true,?????????????????????????iframeTemplate: new Template(''),?????????????????????????width: 750,?????????????????????????height: 400??????????????????????????????????????????}?????????????????);??????????????????????????????????new Control.Modal($('setgoals'),?????????????????{?????????????????????????iframe: true,?????????????????????????iframeTemplate: new Template(''),?????????????????????????width: 750,?????????????????????????height: 500??????????????????????????????????????????}?????????????????);??????????????????????????????????new Control.Modal($('takequiz'),?????????????????{?????????????????????????iframe: true,?????????????????????????iframeTemplate: new Template(''),?????????????????????????width: 815,?????????????????????????height: 550??????????????????????????????????????????}?????????????????);?????????????????new Control.Modal($('nickelbag'),?????????????????{?????????????????????????iframe: true,?????????????????????????iframeTemplate: new Template(''),?????????????????????????width: 815,?????????????????????????height: 550??????????????????????????????????????????}?????????????????);???????????????????????????????????????????});??????????function addCloseLink() { ?????????new Insertion.Bottom('modal_container', "

close

");?????}?????????function test(){??????var current_modal = Control.Modal.current;??????current_modal.close();?????}???

Posted June 14th, 2007 at 10:43am by mrbaseball9

well apparently I don't know how to post the proper code. Just take my word for it that I'm using a custom iframe template =)

Posted June 14th, 2007 at 10:45am by mrbaseball9

Login or Register to Post