Welcome Guest[3.145.59.89], connected from
Sliding door buttons technique revisited...
|
12-19-2009, 06:07 PM
(This post was last modified: 12-22-2009 11:20 AM by exdiogene.)
Post: #1
|
|||
|
|||
Sliding door buttons technique revisited...
This tutorial is to help new theme designers and coders to know the "sliding door" technique to create and display many buttons of different width, with only one image. I hope that this tutorial will help MyBB people to understand a little bit more how they can decrease the downloading time of a webpage having many single images buttons compare to only one image. Here are some facts : A webpage having 10 menu buttons and 10 other buttons elsewere in the page will take approximately 9 seconds to download with a 56Kbauds modem if the average size of the images are 3KBytes. ( 20 buttons * 3KB = 60KB ) ( 56Kbauds modem transfer at an average of 3KBytes/second ) ( 60KB / 3KB = 20 seconds ) With this technique one single 3KB image is needed for all buttons taking less than 1 second even with the extra text needed to create all buttons. Please note that you must also include a javascript portion for the browsers not able to handle the features actually available with FireFox for the button movements on actuation. The second biggest advantage of this technique compared to the graphic buttons is that it is very easy to create new buttons with different text on the fly, not needing any graphic editors. So we need first an image suitable for all our buttons, i have choosen a wood stick for this tutorial. As you can see i created a 800 pixels image to suit any portion of the screen and high enough to insert multiple line of text if needed. Here is the image i will use (reduced to 700 pixels for this page): Here are some sample buttons created with this technique, click on them to see the effect : To achieve this effect you need two things : First, you have to create your HTML content to display your buttons at the proper places formated the proper way, like this : PHP Code:[Highlight] <ul class="TheButton" style="font: 900 12px/16px 'Arial', Helvetica, sans-serif;"> Second, you need to create your CSS entries to view the buttons and links properly, here is how you do this : PHP Code:[Highlight] ul.TheButton { This is what was used to create the 3 first buttons in the precedent frame. You can use this method to create vertical and horizontal menus easily... The buttons are created with two sections, the left one is the one containing the "link" and the right one is just a copy of the right end of the image. The images movements are done using the link CSS attributes changing only the vertical placement of the background images and the vertical padding of the text. Some old versions of Internet Explorer have difficulties achieving the images movement because they do not react to the mouse click properly. This can be corrected using javascript to do the job, using this : PHP Code:[Highlight] <script> To use the javascript you need to modify your HTML code for this instead : PHP Code:[Highlight] <ul class="TheButton" style="font: 900 12px/16px 'Arial', Helvetica, sans-serif;"> This is all for the moment i will continue the explanations soon. Meantime you can use this code freely(without the images that are copyrighted to Regentronique) and look at these new sample buttons i just made using a 2 images technique : |
|||
Post: #2
|
|||
|
|||
RE: Sliding door buttons technique revisited...
eh? i dont really get it. where's the open door thingy
|
|||
Post: #3
|
|||
|
|||
RE: Sliding door buttons technique revisited...
Very useful dude thx
|
|||
Post: #4
|
|||
|
|||
RE: Sliding door buttons technique revisited...
(02-05-2010 12:23 AM)LuminousX Wrote: eh? i dont really get it. where's the open door thingy The sliding door effect is attibuted to the fact that two images are kind-of overlapping themself for different width, like the movement of a sliding door... |
|||
0 member(s) viewed this thread in the last 365 days :
|
« Next Oldest | Next Newest »
|
WWWHostingServer.com
|
||||||
|
||||||
|
|
|
|
|
Powered By MyBB, © 2002-2024 MyBB Group. Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes. Hosting provided by WWWHostingServer.com |