Note that there are some explanatory texts on larger screens.

plurals
  1. POChange content with Jquery (Paginate)
    primarykey
    data
    text
    <p>Hy everyone i've been trying for 2 days to modify this script so i can call it whenever a link had the id="paginations" unsuccessful of course ( just because i'm a newb ). </p> <p>What exactly i am trying to do is call this function to load and change the #content even if the link is inside the #content. Like this. </p> <pre><code> &lt;div class="pagination"&gt; &lt;a href="test.php"&gt;clik2&lt;/a&gt; &lt;/div&gt; </code></pre> <p>I've trying to create a function and call it with onClick but i was unsuccessful. This script works perfectly if the link is outside the #Content but i need it to work inside the #Content also. Any ideas please ?</p> <p>$(document).ready(function() {</p> <pre><code>var hash = window.location.hash.substr(1); var href = $('.pagination a').each(function(){ var href = $(this).attr('href'); if(hash==href.substr(0,href.length-5)){ var toLoad = hash+'.html #content'; $('#content').load(toLoad) } }); $('.pagination a').click(function(){ var toLoad = $(this).attr('href')+' #content'; $('#content').hide('1000',loadContent); $('#load').remove(); $('#wrapper').append('&lt;span id="load"&gt;&lt;/span&gt;'); $('#load').fadeIn('slow'); window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5); function loadContent() { $('#content').load(toLoad,'',showNewContent()) } function showNewContent() { $('#content').delay(100).show('fast',hideLoader()); $(window).scrollTop(''); } function hideLoader() { $('#load').delay(300).fadeOut('fast'); } return false; }); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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