X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   body onload not working (https://forum.x-cart.com/showthread.php?t=36908)

dgallek 01-21-2008 11:37 AM

body onload not working
 
In my home.tpl, I am trying to initialize two functions:
P7_initPM
MM_preloadImages
in the body tag.

Here's the coding in my home.tpl

Code:


</head>
<body{$reading_direction_tag}{if $body_onload ne ''} onload="javascript: P7_initPM(1,0,1,0,0);MM_preloadImages('../../template-files/2newsletter.jpg','../../template-files/2festool.jpg','../../template-files/2internetstore.jpg','../../template-files/2flitch.jpg','../../template-files/2cart_empty.gif');{$body_onload}"{/if}>
{include file="rectangle_top.tpl" }
{include file="head.tpl" }
{if $active_modules.SnS_connector}
{include file="modules/SnS_connector/header.tpl"}
{/if}



When I view the actual page source, the body tag looks like this:

<body>

How do I correctly add my functions to the <body onload in home.tpl?

dgallek 01-22-2008 10:14 AM

Re: body onload not working
 
Okay, after some juggling the code around a bit, I found that this works:

Code:


<body onload="P7_initPM(1,0,1,0,0);MM_preloadImages('../../template-files/2newsletter.jpg','../../template-files/2festool.jpg','../../template-files/2internetstore.jpg','../../template-files/2flitch.jpg','../../template-files/2cart_empty.gif')"{$reading_direction_tag}{if $body_onload ne ''} {$body_onload} {/if}>



All times are GMT -8. The time now is 03:06 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.