PDA

View Full Version : Problem Ajax Tabs Content Script (v 2.2) and Facebox 1.3



spectrom
01-02-2017, 08:55 PM
Script Title: Ajax Tabs Content Script (v 2.2)


Hello, I am French, my English is bad lol
My problem with Ajax Tabs Content Script (v 2.2) is the use of a lightbox link in the external page.

The ligntbox link does not work in an external page without going through iframe
I use the function rel = "countrycontainer"

The css and lightbox script is in the <head>. Of the main page that calls the "countrycontainer". When I click on the link it 'opens in the normal page and does not load in ligntbox. I use Facebox 1.3.

Here is the code in my external page:

<a href="content/messaging.php" rel="facebox"> <div id = "pp2"> View </ div> </a>

It is therefore correct. Should you use MANDATORY page in iframe to run?

jscheuer1
01-03-2017, 02:23 AM
Off hand I would say yes. But I think there's a way to do it without iframe, which I think is desirable because any sort of content displayed within an iframe is usually limited to that frame. There are also ways to overcome that sometimes. But I'm a little confused what you are trying to do. You mention lightbox and facebox. These are two different yet somewhat similar scripts.

Because of the language barrier, perhaps it would be easiest if you posted a link to your page where you are trying this and have it in the iframe.

spectrom
01-03-2017, 08:24 AM
OK then...
The facebox link does not open in floating window in the Ajax Tabs Content Script (v 2.2)
It opens in full page like a classic link.

jscheuer1
01-03-2017, 06:20 PM
I would first try using the instance.onajaxpageload function to initialize the content imported from the external page.

To use this method, you would have the facebox and jQuery scripts and the facebox css on the "top" page (the one with the tabs on it). Then where you go to initialize the tabs script - say you have something like so:


var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

To make facebox links on messaging.php work in the tab, add the highlighted:


var countries=new ddajaxtabs("countrytabs", "countrydivcontainer")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

countries.onajaxpageload = function(pageurl){
if (pageurl.indexOf("messaging.php")!=-1){
jQuery.facebox.settings.closeImage = 'facebox/closelabel.png'; // change to path relative to the 'top' page
jQuery.facebox.settings.loadingImage = 'facebox/loading.gif'; // change to path relative to the 'top' page
jQuery('a[rel*=facebox]').facebox();
}
};


If you want more help, please post a link to the page on your site with the problematic code.

spectrom
01-04-2017, 08:59 PM
super, is very good !
This works perfectly!
I do not know if I have to make a new message but can not run a link in a form button. Here's what I put:


<form>
<input type="submit" value="AJOUTER" class="pclubvalid" onclick="javascript: countries.loadajaxpage('content/pnovalidok.php')" />
</form>

And curiously it returns on the page of the form and not the desired page

jscheuer1
01-04-2017, 10:04 PM
There are various ways to fix that. Here's one:


<form onsubmit="countries.loadajaxpage('content/pnovalidok.php'); return false;">
<input type="submit" value="AJOUTER" class="pclubvalid" />
</form>

There still might be other problems, but assuming a regular link would work, then this will.

Again, if you want more help with this one, please post a link to your page.

Oh, and yes, usually a new thread should be made for a new question, but I'll allow it this time. If you have more questions not related to these two, please start a new thread.