I have an entry level with javascript, but i have been trying FLOATBOX, and i get it works.
Now i am stuck, with fb.start. i have it working with 2 popups, but i can't make them close where i want, in the example i created, as soon as the page load fb.start open the popup windows always from the center, and close to the center.
How can i assign fb.start the place from where i want to open and close the popup windows?
You can see the example here:
http://elduran.sytes.net/samplefb
Thanks in advance
fb.start modify open and close position
Page: 1
Author | Post |
---|---|
#1 Wed Mar 05, 2014 4:11 am
|
|
Member
Registered: Mar 2014
Posts: 5
|
|
#2 Wed Mar 05, 2014 6:35 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
There are startAt and endAt options provided to do exactly this. Here's what the Options Reference has to say about them:
|
#3 Wed Mar 05, 2014 3:28 pm
|
|
Member
Registered: Mar 2014
Posts: 5
|
Thanks for your answer, it works
Now, my question is, after close, i noticed, i can't open it again from the element i set to start, and i would like to have the option to open it again, in case the user need it without refresh the link is http://elduran.sytes.net/samplefb Thanks |
#4 Wed Mar 05, 2014 10:38 pm
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
Sorry, I don't understand. If you want a floatbox to open when clicking an element, just set up a standard floatboxed link around that element. This is the basic operational mode of Floatbox. I also don't know what it is you are trying to show me with those two floatboxes that autoStart on page load on your linked page.
|
#5 Thu Mar 06, 2014 1:37 am
|
|
Member
Registered: Mar 2014
Posts: 5
|
Thanks for your answer
What i am trying to do is to open the popup windows when page load using fb.start from the element i select using startAt, it is solved. But if i setup the standard floatbox link, on the element and the user click on it without close the popup window, it will open the popup window again because it is outside the fb.DOMReady script, and that will give me the same popup window twice, is there any way to avoid that?, maybe if i setup the floatbox link on the fb.start ?, if yes how can i do that. Thanks |
#6 Thu Mar 06, 2014 10:31 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
I'm still confused, but that happens easily.
I think there's some overlap in this thread about starting in the sense of the document coordinates where the animated enlargement originates from and starting in the sense of firing up a floatbox from a click or autoStart action. Two entirely different things. Regardless, it raises my eyebrows when I see you refer to starting something in an fb.DOMReady function. That's not a great way to do it. Just have one link on your page for the content you want to show in a Floatbox. If you want that content to be shown at page start, as if a user clicked the link right away, just put "autoStart:true" in its options. If a user clicks a link again when a corresponding floatbox is already open, nothing will happen. I think the problem is you've set up two items, one in a link on your page, and one with an fb.start command fired from fb.DOMReady. I don't think you want two items. Just use the one link and put "autoStart:true" on it if you want it to auto-start. |
#7 Thu Mar 06, 2014 2:13 pm
|
|
Member
Registered: Mar 2014
Posts: 5
|
I know it's a little confuse, i'm sorry, i am not explaining well.
"autostart:true" only works for 1 popup window, and i want to autostart 4 popup windows, that's why i am using fb.start, and i have to keep the link for the content out of the fb.DOMReady function in case the user close the popup window, and want to open it again, and you are right i don't want two items. Thanks |
#8 Fri Mar 07, 2014 8:36 am
|
|
Administrator
Registered: Aug 2008
Posts: 3382
|
Just have the one link on the page, and load that with fb.start(), instead of creating a new duplicate item at page start.
Put an id on the link, something like id="theId". Then start that link by referencing its id. fb.start( "theId" ). Now its the actual linked item that's showing and it can't be duplicated by clicking on the link while it's already showing. |
#9 Sun Mar 09, 2014 7:05 pm
|
|
Member
Registered: Mar 2014
Posts: 5
|
Thanks for your help, now it works like i want.
|
Page: 1