Rank: Member
Joined: 2/21/2007(UTC) Posts: 1,113
|
Is there a way to write a script that will change an image depending on the state of a customer's shopping cart? So that once they ad an item to their cart, a particular image area changes from one image to another? |
|
|
|
|
Rank: Member
Joined: 5/24/2004(UTC) Posts: 4,147
|
Absolutely, just depends on what you're going for, because there are a few ways to do it, from vb.net/css class to vb.net/img tag to javascript, etc. For example, if it's something like a cart icon that you want to change to display as 'filled' when there are items in the cart, you might use a background image and tell the element to change the CssClass when the cart > 0. This way you could handle the rest via your stylesheet. Is that what you're wanting to do? |
|
|
|
|
Rank: Member
Joined: 2/21/2007(UTC) Posts: 1,113
|
Thanks Cliff -- didn't think about CSS -- I'll have to jump into that and see if that works -- Yes, that's exactly what I want to do -- I'm building my theme around a store "mascot" and one of the images involves the cart. I wasn't aware that you could call the cart contents from CSS. |
|
|
|
|
Rank: Member
Joined: 5/24/2004(UTC) Posts: 4,147
|
You can't actually check for the cart contents via CSS, but if you use VB.Net in the code-behind to change the CssClass of the cart icon (or mascot) you can change the image via CSS more conveniently than in the code.
If I can find some time to play with it, I'll try to post an example. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.