Note that there are some explanatory texts on larger screens.

plurals
  1. POcalling jQuery supersized plugin onclick
    text
    copied!<p>I am trying to call the supersized plugin (http://buildinternet.com/2009/02/supersized-full-screen-backgroundslideshow-jquery-plugin/) onclick, so far when i click on my diferent menus the images are changed, but it looks like html markup build by supersized dont get rebuild, right now i got this:</p> <p>html wich calls a function brown() onclick:</p> <pre><code>&lt;ul id="rooms_menu" style="display:none;"&gt; &lt;li&gt;&lt;a href="javascript:;" onclick="brown()"&gt;menu title&lt;/a&gt;&lt;/li&gt; &lt;p class="rooms_desc"&gt;description text&lt;/p&gt; </code></pre> <p>the html where i echo an ajax response:</p> <pre><code>&lt;div id="script"&gt; &lt;script&gt;$(function(){ $.supersized({ slides : [ {image : 'img/rooms-default.jpg'} //{image : 'img/rooms-default.jpg'} ] }) })&lt;/script&gt; &lt;/div&gt; </code></pre> <p>brow() is an ajax function:</p> <pre><code> function brown(){ $.ajax({ url: 'ajax.php?action=brown', success: function(data){ $('#script').html(data); } }) } </code></pre> <p>then the ajax.php file loads its content to #script div:</p> <pre><code>switch($_GET["action"]){ case "brown": echo "&lt;script&gt;$(function(){ $.supersized({ slides : [ {image : 'img/rooms-brown-01.jpg'}, {image : 'img/rooms-brown-02.jpg'} ] }) })&lt;/script&gt;"; break; case "rose": etc..... </code></pre> <p>so the images are updated when i click for the first time on a menu but if i click another menu title the images are updated too but the slideshow starts messing , it looks like the html markup is not rebuild, when i use only one image per menu title(only one image in supersized array) there is no problem. R.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload