Home › Forums › JavaScript › jquey background to change every few seconds
- This topic is empty.
-
AuthorPosts
-
March 17, 2013 at 5:23 am #43451CarraraWebsiteSolutionsParticipant
Have done some testing but only changes back ground when click to different page I would like it to change every few seconds regardless of what page its on.
I do have my own cookie function
and code here is what is in HTML/head http://codepen.io/mwbcomputers/pen/tqxzn
Please feel free to view. I have tried different places to put functions my cookie is placed in mwbtheme01/stylesheet/mwbcomputerscookie.js
March 17, 2013 at 7:37 am #128537devil3682116Participantdo you want to have site like this where background picture changes??
http://hiraworldtravel.com/view its source code.
March 17, 2013 at 7:49 am #128538notfilcMemberThe code you’ve posted is a mess – make a reduced test case and you will get more help. I have no idea if this is the right method but the first thing I’d try is giving a class (which outlines the background) to the body and changing that class after a period of time with jQuery.
March 17, 2013 at 8:12 am #128541JohnMotylJrParticipant@mwbcomputers,
I am un-sure what you are wanting to do with the cookie stuff, however I have a test-case for ya.
Test Case for color changing:
http://codepen.io/johnmotyljr/pen/hJjgI
Test Case using images: (Kinda comical approach)
March 17, 2013 at 8:15 am #128542CarraraWebsiteSolutionsParticipantto @devil3682116 Yes just like that trying to add it in my header.tpl using open cart. But make my own stuff.
March 17, 2013 at 8:18 am #128543CarraraWebsiteSolutionsParticipantto @JohnMotylJr also that is what I am like but instead of colors put images for example my images are kept in catalog/view/theme/image/bg1.png etc
Also where would I add the js in the head or best to make on separate js file and link it
March 17, 2013 at 8:25 am #128544CarraraWebsiteSolutionsParticipantto @JohnMotyljr
I have come up with this but juts need to change colors to images now http://mwbtheme01.mwbcomputers.com.au/
March 17, 2013 at 8:51 am #128545JohnMotylJrParticipantMarch 17, 2013 at 9:24 am #128546CarraraWebsiteSolutionsParticipantTO JohnMotyIJr
Images not loading your code is correct think its way done on my one http://codepen.io/mwbcomputers/pen/qywEh only colors still flashing
March 17, 2013 at 9:35 am #128547JohnMotylJrParticipant@mwbcomputers,
Click on the settings icon (top right of js) and add the jquery library. Remove the script tags as well..
March 17, 2013 at 9:57 am #128548CarraraWebsiteSolutionsParticipantTo @JohnMotylJr
It worked in codepen example here http://codepen.io/mwbcomputers/pen/qywEh
But i created new js file in dreamweaver and saved it as mwbcomputers.js and linked it like
No Joy Only Joy On Code Pen
March 17, 2013 at 9:57 am #128549CarraraWebsiteSolutionsParticipantSorry wont show other link
March 17, 2013 at 10:22 am #128550CarraraWebsiteSolutionsParticipantPlus now colors won’t go away after been removed code still flashing with out code
March 17, 2013 at 10:59 am #128551CarraraWebsiteSolutionsParticipantTo All tank you for help finally worked out what was problem it was so simple. Easiest things are sometimes hard to find.
March 17, 2013 at 11:14 am #128552CarraraWebsiteSolutionsParticipantSorry on last thing only thing that’s wrong with the js code is doesn’t load up straight to image as seen on here start as a white background demo here http://www.mwbcomputers.com.au
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.