Joomal Body onload only index page

Discussion in 'Joomla' started by seosheela, Jul 31, 2011.

  1. #1
    hello everybody i have addedd my joomla website flash popup in index.php body onload this is show all pages but i need only home page , please help me wahat can i do

    my joomla website : http://homeozone.org
     
    seosheela, Jul 31, 2011 IP
  2. jw-extensions.net

    jw-extensions.net Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You need body onload to auto start a javascript, don't you? It no need to do like that.
    To detect front-page, you can user menu, or simple put a module position only display on frontpage. When this module display, it means we are on front page. Put a code of javascript here. For example: you have a funtion myonload() {...}; put <script langage='javascript'> myonload(); </script> in the area of this module. Hope that help you!
     
    jw-extensions.net, Aug 2, 2011 IP
  3. schlogo

    schlogo Well-Known Member

    Messages:
    1,615
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    140
    #3
    hello, use the following code at the end of the page, just before the </body> tag !, Should work !

    <?php $menu = &JSite::getMenu(); ?>
    <?php if ($menu->getActive() == $menu->getDefault()) { ?>
    <script>load your script here</script>
    <?php } 
    ?>
    
    Code (markup):
     
    schlogo, Aug 3, 2011 IP
  4. jw-extensions.net

    jw-extensions.net Peon

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Excellent code!
     
    jw-extensions.net, Aug 3, 2011 IP