If this is your first visit, check our documentation. To post, register or login.

CSS buttons v2.x

Started by paulm on 19 Sep 2006, 7:55 PM · Views: 41,343

Results 141 to 159 of 159
25 Feb 2011, 8:03 PM
#141
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #141 by athena

I'm still struggling...but i used his style sheet as a pattern....via Firefox webtools....thankyou...but i earned the help....too many hours at this....

My big issue is I can't seem to get any of the individual buttons to obey my styles. Looking at firefox's stylesheet reference on my site, I don't see the individual buttons pulling anything other than the .cssButton and .cssButtonHover For instance:

.cssButton {
	color:#FFF;
	font-weight:bold;
	height:22px;
	line-height:22px;
	border:0px; 
	padding-bottom:4px; 
	margin:0px;
	background:no-repeat;
	}
.cssButtonHover{
	color:#FFF;
	font-weight:bold;
	height:22px;
	line-height:22px;
	border:0px; 
	padding-bottom:4px; 
	margin:0px;
	background:no-repeat;
	}

Then i give each button a width that matches the text and made up some button background images in standard widths of 80px, 100px, 120px and 160px but it does not pay attention to this:

.button_add_address {
width:120px; 
background-image:url("/Products/includes/templates/classic/images/120pxGreenBtn.gif")
}
.button_add_to_cart:hover {
width:120px; 
background-image:url("/Products/includes/templates/classic/images/120pxBluBtn.gif")
}

I'm toggling between two test style sheets...wow is it already 3 o'clock! ...FRIDAY!!!! so if you check the link My site you may see varied results.

26 Feb 2011, 12:12 AM
#142
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #142 by sawhorse

It looks like you have the On Order button working in FF. It does have a different length than all the others.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

26 Feb 2011, 6:10 PM
#143
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #143 by athena

Well...i've come to the conclusion that after trying virtually every mod for rollover buttons ever invented for zencart, that rendering the original stylesheet_css_buttons.css for background images to serve as button images is the way to go. It requires the least intrusive methods, minimal editing of html_output.php to get the form buttons to roll, but you settle for the possible browser fonts, however clearer text on your buttons to be sure.

Zen mod: Dynamic Rollover Input Buttons is the winner in this regard. Very clean stylesheet and the background images he supplies are easily modified. It would have saved me a week if found 40 work hours ago. Very grateful.

Did not mean to hyjack this thread. This mod css buttons v2.x only flaw is having to run the sql script and still not being able, at least at my coding knowledge level, to make your chosen image buttons roll. I was able to get it to work with easy rolloevers mod, but then still had the issue with the form or input buttons not rolling.

so Dynamic Rollover Input Buttons it is. There are links in the mod packet to great examples of what can be done with it.

26 Feb 2011, 10:53 PM
#144
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #144 by sawhorse

I am glad that you found an effective CSS button process.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

1 Mar 2011, 8:24 PM
#145
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Post #145 by chadderuski

Sawhorse:

Could either chadderuski or yourself share your process etc.?

Sawhorse.

Hey Sawhorse!

Sorry I missed out on these latest posts. My solution to CSS rollover buttons does use background images or "sprites" as they are also called. When you roll over a button, the css controls the location of the background in the "window". This method is very common these days as you do not have any blinking going on as you do when you swap images.

You build each button and the state you need. Look here for simple example of 3-state button (normal, hover, and click):

http://chicagophoto.net/btest/

On Royal Industries I'm just using a two-state button. Your style sheet is the workhorse, here is a partial sample:

 
/* General Button Styling Definitions */
.cssButton {
	height:27px;
	border:0px; 
	padding:0px; 
	margin:0px;
	text-indent:-500em;
	background-position: 0 0;
	display:block; 
	overflow:hidden; /* needed for IE */
	}

/* Primary Class :hover and :active states */
.cssButton:hover {
	background-position:0px -27px;
	}

/* .cssButton:active { background-position:0 -54px} */
.button_add_address {width:120px; background:url(../buttons/english/button_add_address.gif) }
.button_add_to_cart {width:120px; background:url(../buttons/english/button_add_to_cart.gif) }
.button_back {width:68px; background:url(../buttons/english/button_back.gif) }

Notice: text-indent:-500em;
I do this to slide zencarts CSS button texts off the button.

There are some core edits that have to be done, and I'd have to dig to find them as it's been ages since I looked at the code. BTW, Royal in now on 1.3.9h.
All form buttons work also (with the core edits!). Note that there are some forms that seems to be done differently than others. Some inconsistencies that
I found (but don't remember!). My solution also allows you to send over-rides within the code for fine tuning placement of the buttons.

Does that make sense? Royal is fully "zoomable"... it doesn't break when you blow it up to fit a larger screen - tested on 30" apple cinema display!

I thought I had posted the core edits in this thread, but perhaps not... Let me know if you'd like to give this a try. Perhaps some day I'll make a contrib out of this.. ;p

1 Mar 2011, 8:48 PM
#146
chadderuski avatar

chadderuski

Totally Zenned

Join Date:
Apr 2006
Location:
Dark Side of the Moon
Posts:
986
Plugin Contributions:
0

Post #146 by chadderuski

Concerning above post:

To use my concept you need these two edits to your /includes/functions/html_output.php

On or around line 267 is the function zen_image_submit();

edit the if statement to this:

    if (strtolower(IMAGE_USE_CSS_BUTTONS) == 'yes' && strlen($alt)<30) return zenCssButton($image, $alt, 'submit', $sec_class, $parameters );

Then just a bit lower comment out the original function zenCssButton() and put this code in:

/**
 * generate CSS buttons in the current language
 * revised code and concepts by Chadderuski and Sir John Steed
 * Allows full control of all link and form buttons through CSS stylesheet.
 * This revised function replaces the standard zenCssButton() above.
**/
function zenCssButton($image = '', $text, $type, $sec_class = '', $parameters = '') {
   if (strrpos($image, '.') !== false) $sec_class = substr($image, 0, strrpos($image, '.'));
   if (!empty($parameters)) $parameters = ' ' . $parameters;

   // form input button
   if ($type == 'submit'){
     // $css_button = '<input class="cssButton ' . $sec_class . '" ' . ' type="submit" value="' . '"' . $parameters . ' />';
     // $css_button = '<input class="cssButton ' . $sec_class . '" ' . ' type="submit" value="' .$text . '"' . $parameters . ' />';
     $css_button = '<button class="cssButton ' . $sec_class . '" ' . ' type="submit" ' . $parameters . ' >' .$text . '</button>';
   }
   // link button
   if ($type=='button'){
      $css_button = '<div class="cssButton ' . $sec_class . '"' . $parameters . '>'. $text . '</div>';
   }
   return $css_button;
} 

Notice the two commented out line under 'submit' ... you can experiment with this if you like. But code as is works well. There ARE some pages that seemed to need
tweaking for button placement.

As always, experiment on a backup/test site! If you want to try this with the three states buttons, PM me and I'll get you the buttons and CSS.

-cj

1 Mar 2011, 10:45 PM
#147
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #147 by sawhorse

Thank You for Sharing your Information. I am sure all CSS users will find it very useful.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

21 Mar 2011, 3:15 PM
#148
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #148 by athena

cj...thank you for that.

I'm curious about your styling of individual buttons. the only one I have an issue with is the View button on the "Your Account" page.

I am not using your method as I prefer having only three background images to deal with. I'm using the default text and still going with Dynamic CSS Input Buttons mod.

Wondering if styling individual buttons is where your core edits come in. I tried just adding to the style sheet:

.BUTTON_IMAGE_VIEW_SMALL {
	width:auto;
	}

any insight appreciated. Hate modifying core code.

21 Mar 2011, 4:09 PM
#149
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #149 by athena

Since this View button seemed like the only button with width issues, I used the template override system by changing the width to 80px and padding (8px) of the table column to match the width of the submit buttons in the mod of 80px in:

includes > templates > mytemplate > templates > template_account_default.php

<table width="100%" border="0" cellpadding="8px" cellspacing="0" id="prevOrders">
<caption><h2><?php echo OVERVIEW_PREVIOUS_ORDERS; ?></h2></caption>
    <tr class="tableHeading">
    <th scope="col"><?php echo TABLE_HEADING_DATE; ?></th>
    <th scope="col"><?php echo TABLE_HEADING_ORDER_NUMBER; ?></th>
    <th scope="col"><?php echo TABLE_HEADING_SHIPPED_TO; ?></th>
    <th scope="col"><?php echo TABLE_HEADING_STATUS; ?></th>
    <th scope="col"><?php echo TABLE_HEADING_TOTAL; ?></th>
    <th scope="col" width="80px"><?php echo TABLE_HEADING_VIEW; ?></th>
  </tr>
21 Mar 2011, 4:43 PM
#150
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #150 by athena

I also solved the button disappearing from a tip on an older thread about the issue, removing the style for input:focus:

IN STYLESHEET.CSS CHANGE:

input:focus, select:focus, textarea:focus {
background: #F0F8FF;
}

TO:

select:focus, textarea:focus {
background: #F0F8FF;
}

3 Apr 2011, 7:13 AM
#151
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #151 by sawhorse

This is a just in case you are having the same problem I was having and can't find the solution post.

I was trying to make a button smaller in width. I wanted it to be 65px and it was currently 80px wide.

I went into the /public_html/includes/template/YOUR TEMPLATE/css/stylesheet-css_buttons.css and tried to make the change. However, the change never stuck. I searched for hours trying to find out the solution. I could change the width in firebug but of course that is only temporary.

The solution is in /public_html/includes/functions/html_output.php at about Line #305 :

$min_width = 80; // this is the minimum button width, change the value as you likeAll you need to do is change that minimum width from 80 to the width of your choice.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

3 Apr 2011, 6:41 PM
#152
swamyg1 avatar

swamyg1

Zen Follower

Join Date:
Dec 2008
Location:
San Fran
Posts:
382
Plugin Contributions:
0

Post #152 by swamyg1

Do you guys think that the sliding doors method might be bit outdated? We now have CSS3, I know all browsers don't quite support it but it's definitely growing in popularity. With CSS3 we can add gradients and drop shadows to buttons without any images.

Would like to get your thoughts on this!

3 Apr 2011, 11:44 PM
#153
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #153 by sawhorse

All I know about CSS3 is something I heard about IE9 supporting it in Oct of last year. I personally like to wait a bit for things to settle before I jump in. But, I agree that CSS3 seems to be the direction to go in the very near future for any new web pages. The old works, the new (most likely) will work better.

Sawhorse

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

3 Aug 2011, 12:36 AM
#154
runlikeagirl avatar

runlikeagirl

New Zenner

Join Date:
Jun 2011
Posts:
14
Plugin Contributions:
0

Post #154 by runlikeagirl

Hello,

Does CSS buttons work fine with 1.3.9h fresh install?
Please let me know if you installed it already.

Thanks

3 Aug 2011, 12:59 AM
#155
sawhorse avatar

sawhorse

Zen Follower

Join Date:
Oct 2007
Location:
Kentucky - USA
Posts:
425
Plugin Contributions:
0

Post #155 by sawhorse

Sorry, I can not help. I am waiting a bit and will go to Zen Cart 1.5 from 1.3.8a

ZC 1.3.8a; Addons: Admin Profiles, Ty Package Tracker; Swap Images via MouseOver or Click, Smart Backgrounds; Printable Price List; CSS buttons; Contact Us - Add Subject; Template: Self Constructed; Site: http://sawhorsejewelry.com

12 Aug 2011, 4:20 AM
#156
rizla avatar

rizla

Zen Follower

Join Date:
Sep 2010
Posts:
449
Plugin Contributions:
0

Post #156 by rizla

I have a question:
I am looking for something that changes the standard Prev/Next navigation into something like small buttons... does this module alloow that?

22 Aug 2011, 7:47 PM
#158
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #158 by athena

I apologize for the quick response up there.

I have had to adjust a few things - forgot, but some of that is in my previous two post from a few months ago

....I don't have time as I'm leaving for a few days but will post here how I fixed the nav buttons.

31 Aug 2011, 5:10 PM
#159
athena avatar

athena

Totally Zenned

Join Date:
Jan 2006
Location:
NM
Posts:
740
Plugin Contributions:
0

Post #159 by athena

If using Dynamic CSS Input buttons you have to make sure you've uploaded the includes/templates/your_template/templates/tpl_products_next_previous.php supplied with the mod to get the nav next previous buttons to line up properly. it only shows if there is more than one item in a category. without this file your buttons will just expand on top of one another.