Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / how to make clickable buttons?

how to make clickable buttons?

Locked

Views: 2,659

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
15 Feb 2010, 5:55 AM
#1
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

how to make clickable buttons?

hi I'm new to zen cart and am trying to make buttons move or click in when pushed but i don't know code very good so i don't what to do please help. a .gif image that shows what i am talking about has been attached. Thanks ahead of time:hug:

15 Feb 2010, 10:45 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: how to make clickable buttons?

Why and where in ZenCart are you trying to do this?

Zen-Venom Get Bitten

15 Feb 2010, 11:28 AM
#3
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

all buttons will do this in zen cart. why because i want the buttons to be like the button actually pushes in and pops back out i don't want it to stay pushed i want it to be like pushing a button on your keyboard.

15 Feb 2010, 11:55 AM
#4
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

i found this html code it does what i want but is this what i do in zen cart?

<html lang='en'> <head> <meta http-equiv='Content-type' content='text/html;charset=UTF-8'> <title>Image Click</title> <script type="text/javascript"> function clickDown() { var Bdown = '<img src="pic2.png" alt="picture" onmouseup="clickUp()">'; document.getElementById('b').innerHTML = Bdown; } function clickUp() { var Bup = '<img src="pic1.png" alt="picture" onmousedown="clickDown()">'; document.getElementById('b').innerHTML = Bup; } </script> </head> <body> <h1></h1> <p><span id="b"><img src="pic1.png" width=159 height=100 alt="picture" onmousedown="clickDown()"></span></p> </body> </html>
15 Feb 2010, 12:07 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: how to make clickable buttons?

The zen-cart button-related functions are located in /includes/functions/html_output.php.

15 Feb 2010, 12:10 PM
#6
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

OK thanks. what would i change in this file and will all buttons do it or does each button have to be set separately

15 Feb 2010, 1:26 PM
#7
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

in this file what do i change please forgive me I'm new to all this code stuff and i do not want to change anything until i know what I am changing

15 Feb 2010, 2:00 PM
#8
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: how to make clickable buttons?

It might be simpler to use the stylesheet for this. I Googled for "button click visual effect using CSS" and got some good links talking about this.

Rob

Breakfast: the most important donut of the day.

15 Feb 2010, 2:37 PM
#9
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

OK thanks but I'm not sure what i should be looking for on goggle ??? Is there a way to make a button that is 2 different size images of the same button. When you click the button the smaller button image appears then the big button image reappears to make a push in effect for the button??

15 Feb 2010, 3:11 PM
#10
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

i would just like to thank all of you for your help so far but I'm still stuck if someone could give an example of how to do this it would help very much. thanks again

:oops: I'm just learning sorry

15 Feb 2010, 5:59 PM
#11
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,650
Plugin Contributions:
0

Re: how to make clickable buttons?

I'm just learning sorry

May I suggest you do the things you really need to run your business and then work on the things that are only surface dressing?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

15 Feb 2010, 6:41 PM
#12
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

i this hard? why do you question me i need help with this only. i need to make a button change from one image to another image to make the button look like it moves. but only when someone clicks not when they just put mouse over it. if anyone can help please feel free i just need a basic example of how i would do this and i can handle it from there. all help is greatly appreciated

16 Feb 2010, 2:00 AM
#13
jordin avatar

jordin

New Zenner

Join Date:
Jan 2009
Location:
Sask, Canada.
Posts:
44
Plugin Contributions:
0

Re: how to make clickable buttons?

Does anybody know the most efficient way to do this in zen cart?

I am also wondering the easiest or best way to make my custom button set have visual click effect in zen cart.

I have a custom button set made with 2 images for each button. One image for the button and one for the button when clicked.

Would I have to edit the code in every php file for each button individually or is there a css command I can add to my stylesheet that will let me do this for all buttons at once?

I am hoping there is some way to do this without going into each php file and editing each buttons code individually.

Just looking for a zen cart professionals opinion on which is the fastest or most efficient way to do this on zen cart.

16 Feb 2010, 9:56 AM
#14
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

Please Help i have been doing some searches and i am still stuck. I thought this would be one of the easier things to do :cry:

Does anybody know the most efficient way to do this in zen cart?

I am also wondering the easiest or best way to make my custom button set have visual click effect in zen cart.

Would I have to edit the code in every php file for each button individually or is there a css command I can add to my stylesheet that will let me do this for all buttons at once?

I am hoping there is some way to do this without going into each php file and editing each buttons code individually.

Just looking for a zen cart professionals opinion on which is the fastest or most efficient way to do this on zen cart.

16 Feb 2010, 9:36 PM
#15
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

Does anybody know the most efficient way to make a custom button set have visual click effect in zen cart.I am also wondering the easiest or best way to do this.

I have a custom button set made with 3 images for each button. One image for the button when highlighted second image for button before clicked and third image for button when clicked.
i also have one solid image with all 3 button variations in one stacked above the others.
Example. 1.
________2.
________3.

Would I have to edit the code in every php file for each button individually or is there a css command I can add to my style sheet that will let me do this for all buttons at once?

I am hoping there is some way to do this without going into each php file and editing each buttons code individually.but if it is the only way that is ok.

Just looking for a zen cart professionals opinion on which is the fastest or most efficient way to do this on zen cart.

16 Feb 2010, 9:43 PM
#16
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,650
Plugin Contributions:
0

Re: how to make clickable buttons?

Moderator's note - Please don't repost the same problem in a different thread. Your new post has been merged into your original thread.

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

16 Feb 2010, 9:44 PM
#17
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

different question than other one thats why i made a new thread

16 Feb 2010, 10:08 PM
#18
get_em_fast avatar

get_em_fast

Totally Zenned

Join Date:
Dec 2006
Location:
Seligman, MO U.S.A.
Posts:
2,072
Plugin Contributions:
1

Re: how to make clickable buttons?

kab, there's a nice little tutorial HERE.

Hope this helps.

Teach them to shop and they will shop today;
Teach them to Zen and they will OWN a shop tomorrow!

16 Feb 2010, 10:50 PM
#19
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

thanks for the tutorial i am also wondering if this is the most efficient way of doing this?

17 Feb 2010, 2:07 PM
#20
kab_death avatar

kab_death

New Zenner

Join Date:
Feb 2010
Posts:
14
Plugin Contributions:
0

Re: how to make clickable buttons?

please help i am still stuck i dont know if this is the right way to do the visual effects and if it is how do i apply it to the buttons in zencart?

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>CSS Button</title>

<style type="text/css">

* { margin: 0; padding: 0; /* Quick and Dirty Reset */ }

body {
	background: url(t2.jpg);
}

#demo {
	width: 433px; margin: 100px auto;
}

	#demo p a.press-it-btn {
		display: block; /* Change anchor to block element */
		width: 181px; height: 105px; /* Specify width and height of the image. Height is value of each individual button graphic */
		background-image: url(t1.jpg); /* Add the image as a background */
		background-position: top; /* Set the position to the top */
		text-indent: -9999px; /* Send the rendered HTML wording off screen */
	}
		#demo p a.press-it-btn:hover, #demo p a.press-it-btn:focus {
			background-position: center; /* Set the position to the center */
		}
		#demo p a.press-it-btn:active {
			background-position: bottom; /* Set the position to the bottom */
		}

a { outline: none; }
</style>
</head>

<body>

<div id="demo">
	<p><a href="http://" class="press-it-btn">Press it</a></p>
</div>
`
</body>
</html>

Thanks again.:hug: