AJAX Jquery pagination |
[eluser]SPeed_FANat1c[/eluser]
Hello, I downloaded Jquery pagination library from there http://tohin.wordpress.com/download-section/ but I can't figure out why the page links end with '#' symbol. Can you help me? Code: <?php All pagination links are 'http://darius.tvsprojektai.lt/plotai/test/jquery__pagination/#' The website is in folder 'plotai'.
[eluser]Kamarg[/eluser]
You probably need to return false at the end of the link click event.
[eluser]SPeed_FANat1c[/eluser]
[quote author="Kamarg" date="1272324141"]You probably need to return false at the end of the link click event.[/quote] You mean in view file it must be some javascript events? In the example there wasn't such things. Maybe you can post some example how to do those events? The example view file code was this: Code: <html> Of course I changed my jquery directory. Edit: found a bug - I was set wrong $config['base_url']. I detected this error accidentaly while trying to write code by http://www.weblee.co.uk/2009/06/12/codei...on-part-4/ this example and copying this $config['base_url'] line from Jquery__pagination.php
[eluser]SPeed_FANat1c[/eluser]
I have another problem there. I modiefied the view file and it now looks like this: Code: <html> As you can see I want that function would be executed when I click the link where the class is "trinti". It work when I am in first page. But it doesn't when I am in page other than 1. Any ideas why the script doesn't execute?
[eluser]pickupman[/eluser]
In jQuery when on ready function runs, it grabs any elements you have bound by using a selector. When you have added something to the DOM (page) jQuery doesn't know that it exists. They have integrated the awesome livequery plugin into the core since 1.3. Use this instead: Code: $('.trinti').live('click',function(){ Now anytime anything is added to the DOM, jQuery will rebind the click event on that element you have targeted. The other option is to add this inside of a js function, and when the event that is changing the DOM, you call the function and it will rebind again. More info can be read on jQuery's website.
[eluser]SPeed_FANat1c[/eluser]
[quote author="pickupman" date="1272418939"]In jQuery when on ready function runs, it grabs any elements you have bound by using a selector. When you have added something to the DOM (page) jQuery doesn't know that it exists. They have integrated the awesome livequery plugin into the core since 1.3. Use this instead: Code: $('.trinti').live('click',function(){ Now anytime anything is added to the DOM, jQuery will rebind the click event on that element you have targeted. The other option is to add this inside of a js function, and when the event that is changing the DOM, you call the function and it will rebind again. More info can be read on jQuery's website.[/quote] Thank you very much, it works now |
Welcome Guest, Not a member yet? Register Sign In |