Fire Fancybox from Dropdown Menu?

612 views
Skip to first unread message

SB

unread,
Mar 30, 2011, 8:33:18 AM3/30/11
to fancybox
Is it possible to get fancybox to work from a simple dropdown menu??

ie - Select a link from a drop down list that then opens the iframe in
fancybox.

If anyone can let me know or has any code that would be a great help.

Joonas

unread,
Mar 30, 2011, 8:45:40 AM3/30/11
to fancybox
There is iframe link example there in the front page of fancybox and
the way i see it, link like that makes no difference where you put it.

Joonas

unread,
Mar 30, 2011, 8:49:59 AM3/30/11
to fancybox
Though some guy had posted that he had conflict with a jquery dropdown
menu and fancybox but if its just a normal css drop down menu i dont
see why not.

SB

unread,
Mar 30, 2011, 9:55:44 AM3/30/11
to fancybox
Still no joy.

Adding ?iframe to the end of links isn't doing the trick. Any other
ideas? Can this be worked in somehow? (<a class="iframe"
href="URL">Text</a>)

Using this simple code:

<form name="jump">
<select name="menu">
<option value="URL">Text</option>
<option value="URL">Text</option>
<option value="URL">Text</option>
<option value="URL">Text</option>
<option value="URL">Text</option>
</select>
<input type="button"
onClick="location=document.jump.menu.options[document.jump.menu.selectedIndex].value;"
value="GO">
</form>

Joonas

unread,
Mar 30, 2011, 10:43:36 AM3/30/11
to fancybox
I see... i was thinking of totally different type of menu and not a
dropdown list..

As far as i know.. you wont be able to open it in iframe at all with
dropdown list because well its not <a> and it uses value instead of
href.. which i believe to make huge difference in this matter.

if it has to be menu just like that...
Probably some fancybox editing would be in order.. or you might want
to see if theres dropdown lists like that done in jquery.. one that
uses actual <a> tags.

JFK

unread,
Mar 30, 2011, 2:13:48 PM3/30/11
to fancybox
from the top of my head I think it would be possible using a manual
call method
but let me try it and will come back to you soon

JFK

unread,
Mar 30, 2011, 3:29:41 PM3/30/11
to fancybox
OK, you could use my script to pass custom parameters to fancybox
http://groups.google.com/group/fancybox/browse_thread/thread/22843096d7870691/

so for this HTML
<form>
<select class="myOptions">
<option value="http://google.com/">google</option>
<option value="http://yahoo.com/">yahoo</option>
</select>
<input type="button" onclick="var goURL = $('.myOptions').val();
fancyboxMe(goURL)" value="GO">
</form>

the scrip:
<script type="text/javascript">
function fancyboxMe(url) {
$.fancybox({
'href' : url,
'type' : 'iframe',
'width': '95%',
'height': '90%'
});
}
</script>

Pat

unread,
Apr 14, 2011, 9:04:18 AM4/14/11
to fancybox
JFK,

Could you modify your script, so instead of firing fancybox as iframe
- fire it as a inline?

for example:

<form name="jump">
<select name="menu">
<option value="#inline">Text</option>
<option value="#inline2">Text</option>
<option value="#inline3">Text</option>
<option value="#inline4">Text</option>
<option value="#inline5">Text</option>
</select>
<input type="button"
onClick="location=document.jump.menu.options[document.jump.menu.selectedInd
ex].value;"
value="GO">
</form>


I would really appreciate your help!



On Mar 30, 2:29 pm, JFK <jfk.d...@gmail.com> wrote:
> OK, you could use my script to pass custom parameters to fancyboxhttp://groups.google.com/group/fancybox/browse_thread/thread/22843096...
> > > dropdownlistbecause well its not <a> and it uses value instead of
> > > href.. which i believe to make huge difference in this matter.
>
> > > if it has to be menu just like that...
> > > Probably some fancybox editing would be in order.. or you might want
> > > to see if theres dropdown lists like that done in jquery.. one that
> > > uses actual <a> tags.
>
> > > On 30 maalis, 16:55, SB <samuel.bl...@gmail.com> wrote:
>
> > > > Still no joy.
>
> > > > Adding ?iframe to the end of links isn't doing the trick. Any other
> > > > ideas? Can this be worked in somehow? (<a class="iframe"
> > > > href="URL">Text</a>)
>
> > > > Using this simple code:
>
> > > > <form name="jump">
> > > > <select name="menu">
> > > > <option value="URL">Text</option>
> > > > <option value="URL">Text</option>
> > > > <option value="URL">Text</option>
> > > > <option value="URL">Text</option>
> > > > <option value="URL">Text</option>
> > > > </select>
> > > > <input type="button"
> > > > onClick="location=document.jump.menu.options[document.jump.menu.selectedInd ex].value;"
> > > > value="GO">
> > > > </form>
>
> > > > On Mar 30, 1:49 pm, Joonas <paak...@gmail.com> wrote:
>
> > > > > Though some guy had posted that he had conflict with a jquery dropdown
> > > > > menu and fancybox but if its just a normal cssdropdownmenu i dont
> > > > > see why not.
>
> > > > > On Mar 30, 3:45 pm, Joonas <paak...@gmail.com> wrote:
>
> > > > > > There is iframe link example there in the front page of fancybox and
> > > > > > the way i see it, link like that makes no difference where you put it.
>
> > > > > > On Mar 30, 3:33 pm, SB <samuel.bl...@gmail.com> wrote:
>
> > > > > > > Is it possible to get fancybox to work from a simple dropdown menu??
>
> > > > > > > ie - Select a link from adropdownlistthat then opens the iframe in

JFK

unread,
Apr 18, 2011, 3:21:53 PM4/18/11
to fancybox
you could use the same script... just remove "type": "iframe" off the
options
Reply all
Reply to author
Forward
0 new messages