Hi everyone i am still new to hooks and am wanting to get this javascript to work. It just adds a loader bar when you go to the site for the first time
I have downloaded the file jquery.queryloader2.js and placed it in the js folder
I have edited the styles.post.tpl in my_changes/hooks/index with
The last part of the puzzle is the following code
[font=Consolas,]
$(document).ready(function () {[/font][font=Consolas,]
$(“body”).queryLoader2();[/font][font=Consolas,]
});[/font]
Where exactly would i put this?
[quote name='Confusion' timestamp='1363656619' post='158069']
I have edited the styles.post.tpl in my_changes/hooks/index with
[/quote]
I think you meant to place this in the scripts.post.tpl file in your index hooks folder, correct?
[quote name='Confusion' timestamp='1363656619' post='158069']
The last part of the puzzle is the following code
$(document).ready(function () {
$(“body”).queryLoader2();
});
Where exactly would i put this?
[/quote]
You can place that code in a file named footer.post.tpl inside your hooks/index folder and then clear your cache.
Be sure that you have your file paths set correctly to the js files. It will be relative to the root html directory unless you specify otherwise.
Hi jeremy you are right i meant the scripts.post.tpl file
I have placed the .js file is living in [size=4]/public_html/beachpool/js/[/size][size=4]jquery.queryloader2.js[/size]
[size=4]As you can see here i have that path set in the scripts.post.tpl file[/size]
[size=4][/size]
Once i created the footer.post.tpl file and put in the following code
$(document).ready(function () {
$(“body”).queryLoader2();
});
i started getting
Fatal error[color=#000000][font=Times][size=1]: Smarty error: [in index.tpl line 345]: syntax error: unrecognized tag: $(“body”).queryLoader2(); (Smarty_Compiler.class.php, line 445) in [/size][/font][/color]/home/w3badmin/public_html/beachpool/lib/smarty/Smarty.class.php[color=#000000][font=Times][size=1]on line [/size][/font][/color]1095
I thought that i had done everything correctly.
The readme for the file states.
[size=4]How to use[/size]
----------
Include the script in the head section of your webpage.
Be sure to add it after you include jQuery.
Now call QueryLoader in a $(document).ready() like this:
$(document).ready(function () {
$("body").queryLoader2();
});
Any hints, It is an effect i thought would be cool but i dont know javascript well enough to try and debug it. i really thought it would be a simple matter of adding the script and code to the relevant places
Use {literal} tags around your Jquery code or {ldelim} and {rdelim} like below:
$(document).ready(function (){ldelim}
$("body").queryLoader2();
{rdelim});
Thanks jeremy that got me over the hump.
The page now loads correctly.
i added the rest of the variables so it now looks like
{literal}$(document).ready(function () {
$(“body”).queryLoader2({
barColor: “#6e6d73”,
backgroundColor: “#fff1b0”,
percentage: true,
barHeight: 1,
completeAnimation: “grow”,
minimumTime: 100
});
});
{/literal}
however when the page loads i dont get the expected result and instead just a bar down the bottom of the browser window with the code it in(minus the literal tags)
might just have to call it quits on this one
```php
{literal}
{/literal}
```
You were missing the tags. Without them, the browser doesn't know the code should be processed as a script.
[quote name='StellarBytes' timestamp='1363738685' post='158207']
You were missing the tags. Without them, the browser doesn't know the code should be processed as a script.
[/quote]
I took that one for granted.
works a treat. now to play with the colours.
Thank you so much for your help. i think i have my head around how this all works now
edit: After all that the effect worked about 6 times and then just started getting stuck on 98%
Well at least i have learnt some new skills LOL