Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Dynamic Page Replacing Content which contains javascript

    Hello,

    Hi, I used this tutorial to make my site more dynamic.
    Basically, when I click on a link, only the main content of the page will change and the rest of the page won't be refreshed.

    But the main content of my page contains some javascript that I use for my tables. However even though the swap is now done dynamically, the effects that were on the table are no more here. Is there a way to keep the effect of the javascript please ?

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,479
    Thanks
    6
    Thanked 981 Times in 954 Posts
    Show us your site, please. There is no point in us guessing your set-up.

  • #3
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is the link to the site :

    http://exerion.comule.com/Default.html

    The only available nav link are "Acceuil" and "Semaine prochaine".
    In the first one there should be some effect on the table as here.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,020
    Thanks
    75
    Thanked 4,323 Times in 4,289 Posts
    I'm not sure, but I *think* that all you need to do is call tablecloth( )
    every time you change the content.

    *IF* I am right, go to the file dynamicpage.js and add that where I show below:
    Code:
            function loadContent(href) {
                $mainContent
                        .find("#guts")
                        .fadeOut(200, function () {
                            $mainContent.hide().load(href + " #guts", function () {
                                $mainContent.fadeIn(200, function () {
                                    $pageWrap.animate({
                                        height: baseHeight + $mainContent.height() + "px"
                                    });
                                });
                                $("nav a").removeClass("current");
                                console.log(href);
                                $("nav a[href$=" + href + "]").addClass("current");
                                tablecloth( );            
                            });
                        });
            }
    Please understand that this is mostly a guess.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #5
    New to the CF scene
    Join Date
    Jul 2013
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the answer, unfortunatly it still doesn't work .


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •