| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Cleaning up templates/javascript | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hi Everyone,
I want to try to clear up our templates a bit. I want to reduce the amount of code to make pages smaller/faster, less complex, and easier on search engines (so they have less code to wade through to get to the actual text). This will look like a long post, but please don't be scared away! The answers should be pretty simple. 1) The following Javascript code is included in all our pages: Code:
2) We have a vertical menu on the left side of the site that uses images instead of text for the category names, static pages, etc. We had our site set up so that each image has a dark (standard) version, and a highlighted version for when you mouse over the image. As a result, we have a bit like: Code:
...listed for EACH of the categories. Is there any way to clean this up? Can this all be dumped into a .js file or something? Thank you for your help!
__________________
x-cart 4.0.1 |
|||||||
#2
|
|||||||
|
|||||||
![]() That JS code looks like it is from a Dreamweaver rollover image. Is that what you used for your category images? If so, you don't want to delete that JS or your rollovers won't work
![]()
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
![]() I didn't design the template, rollovers, etc. X-cart just adapted our site's previous design to work with their templates. I have no idea what they did or how it works. I was just wondering if all the "mouseover" stuff could be dumped off to a separate file (or if there's a cleaner, simpler HTML alternative). Of course, I'll just leave it alone unless I'm sure of an alternative (which I would test before implementing live, of course).
I made a test page putting the JS from question 1 in a separate .js file. The page appears to work just fine (but I don't know if that JS does something special that isn't visibly obvious). Also, since it's commented out, I assume it has no real needed function. I assume I'm safe on this one, right? Thanks!
__________________
x-cart 4.0.1 |
|||||||
#4
|
|||||||
|
|||||||
![]() You can probably put it in a different file, but I doubt the rollovers will work (or preload the images) without that script in place. There also seems to be a seperate function in that javascript that controls some sort of zoom pop-up window?
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#5
|
|||||||
|
|||||||
![]() Which are you talking about having a popup, #1 or #2?
There is no popup on our site. If you're talking about #1, I'm guessing that's what's getting commented out (perhaps it's a holdover from our pre-Xcart design). As for #2, I'll leave them as-is. Thanks again!
__________________
x-cart 4.0.1 |
|||||||
#6
|
|||||||
|
|||||||
![]() #1 has popup code in it. Also, I doubt the code in #2 will work without the script in #1.....
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#7
|
|||||||
|
|||||||
![]() Oh, OK. I didn't realize they were related to each other somehow.
On the test page, with #1 called from a separate .js file, the mouseovers still work, so I'll go with that. Thank you for your help!
__________________
x-cart 4.0.1 |
|||||||
|
|||
X-Cart forums © 2001-2020
|