3 Steps to Create Rolling List For Button Images

by SBA on May 24, 2010 · 23 comments

This post is about creating a discreet rolling gadget in the sidebar to show off your friends buttons, badges or blogrolls. The idea for this tutorial came from a question by Sheri at My Bargain Basket:

I’ve seen on another site (I wish I could remember which one) a rolling list of buttons from other sites. I would really like to do this on my site but can not find any coding to do it. Do you have any idea how to accomplish this task?

With this approach you can  a) reduce clutter b) host more buttons c) keep more friends happy d) minimize use of sidebar real estate. Not to mention you can grab buttons to your heart's content.

Warning: I'm using the marquee html tag which has a bad reputation and is officially non-standard Html.  The word marquee brings to mind the flashy structure above a movie house, announcing the movie stars.

Marquee text is distracting. The human eye is attracted to movement, and marquee text is constantly moving.

Many of us run from amateurish websites with horizontal scrolling and blinking text at the top of the pages. This tutorial is very specific, breaking the rules with care. I caution you to use this just for images. Afterall, a slowly rolling gadget may be much less distracting than a sidebar of 30 static images! Don't worry, you'll learn to control distractions.

This is how it looks in your sidebar: (stops after 2 loops so refresh page to view again)

BWS tips button BPWebNews tips button My Bargain Basket

(point to stop scrolling)

Step 1 : Add a default sidebar roller

This works for Blogger and WordPress self-hosted. WP.com  does not allow the marquee tag.

  • Add a gadget or widget. For now, name it "Button Roll."
  • Copy and Paste the following code --- we can change later.
    
    <div style="height:400px; width:130px;">
    <!-- Marquee tutorial by BloggingWithSuccess.net -->
    <marquee direction="Up" loop="5" scrolldelay="500" scrollamount="20" onmouseover=this.stop() onmouseout=this.start() style="height:400px; width:130px;" >
    <!-- Add button images from this point -->
    <!-- Button -->
    <a href="http://BloggingWithSuccess.net"><img src="http://i282.photobucket.com/albums/kk272/SBA_jpgs/bwstipsbutton.jpg" alt="BWS tips button" width="125" height="125" /></a>
    <!-- Button -->
    <a href="http://BPWebNews.blogspot.com"><img src="http://i282.photobucket.com/albums/kk272/SBA_jpgs/bpwebnewstips.png" border="0" alt="BPWebNews tips button" width="125" height="125" /></a>
    <!-- Button -->
    <a title="My Bargain Basket" href="http://mybargainbasket.com" target="_blank"><img style="border: none;" src="http://farm3.static.flickr.com/2473/4141638224_74733062bb_o.png" alt="My Bargain Basket" /></a>
    <!-- Insert your button images BEFORE this closing tag -->
    </marquee>
    </div>
    (point to pause scrolling)
    
  • Save. The sidebar should now scroll 3 button images. You can replace these later.

Step 2: Add your clickable button images.

  • Open your gadget or widget in edit mode.
    Add a marker to place your image separator , i.e.
    <!-- Button -->
    Put this before the
    </marquee>
  • Open another browser window or tab to view the page with the button you want to copy.
  • Copy and paste your friend's grab button code into your gadget  right after the
    <!-- Button --> you just inserted.
  • Repeat for as many buttons as you want. If the button is already in your sidebar, open the widget to copy the image text. When all is well with the rolling list, just delete the individual widgets.

Step 3: Style and Adjust the Rolling Area

This tag controls the widget size, styling and scrolling speed. You will probably not have to change the defaults.

<marquee direction="Up" loop="3" scrolldelay="500" scrollamount="20" onmouseover=this.stop() onmouseout=this.start() style="height:400px; width:130px;" >

Let's break it down:

  1. direction="Up" - Images will roll up. You can change this to "Down" to be different! Also 'Left" and "Right" can be used.
  2. loop="5" - If you have 15 images they will scroll 5 times, then stop. Change the value or use "indefinite" to have it loop forever.
  3. scrolldelay="500" - roll will jump at this speed in milliseconds. Increase to slow down or decrease to quicken.
  4. scrollamount="20" - normally applies to text. 20 pixels would move each time.
  5. onmouseover=this.stop() onmouseout=this.start() - allows reader to stop the rolling when mouse points to an image.
  6. style="height:400px; width:130px;" - if you want a taller or shorter marquee, change the 400. the width of 130 is about the size of a button but you can widen for larger buttons. Don't go over the width of your sidebar.
    *** made the same adjustment to the <div tag which was added just for Internet Explorer.

Open your rolling gadget and edit the values you want to adjust. Save and view the sidebar. Repeat until happy!

Conclusion & Alternatives

Horizontal Rolling Images

You can do something similar for your blog's footer area using the direction="Left". Make the height fit a single button (130 px) and the width as wide as the footer can handle (100% works). Likewise if you want an even more discreet sidebar roller, limit the width to 130 and roll left.

Alternative: Manual Scrolling

If you don't want to be an Html bad girl, then use the manual scroll bars. Be warned that visitors may not voluntarily scroll your button roll.

BWS tips button

BPWebNews tips button

My Bargain Basket

Here's the code: We'll replace the marquee tags with the div which confines the space to hold images and displays a gray scrollbar.

<div style="width: 150px; height: 200px; overflow: auto;">
<a href= ... place images and links here...
</div>

You'll need to play with the size values to fit within your sidebar area and button sizes.

Alternative: JavaScript

Many sites provide javascript for scrolling text and images. I've found them unreliable when authors stop maintaining the external code or get kicked off their free hosting sites due to server overload. Still others require changes to your Blogger template or WP php code.  Let us know if you've found a good script.

Leave a comment when you get your list rolling so we can sit back and enjoy the show!

P.S. Sheri noticed a problem with IE, so the post was updated as of 5/24/10. There's still a problem with IE on her WP theme, but the code should work. Be brave and try it.

4 Reasons For Subscribing
  • Get Full Posts Delivered Directly To Your Inbox.
  • Get Exclusive Freebies For Subscribers.
  • No "Buy This, Buy That" Mails!
  • 100% Privacy. Your EMail Address Will Never Be Shared With Any Third Party.
About Writer [Blogging With Success]About Author SBA is a web designer and co-founder of BloggingWithSuccess. She publishes BPWebNews a place for many Blogspot tips and tricks. You can also find her on Twitter. Read SBA's other posts. She's also published a couple of guest posts.

{ 21 comments }

Felicia October 16, 2010

Shirley,

I need your mad html skillz. I have been using this html code for a few months now without any problem, that is until the last month or so. All of a sudden it has stopped scrolling. Whether I am using IE or Firefox when I open my blog the buttons stretch out either from the top of my blog to the blog roll or from the blog roll to the bottom. It makes the buttons cover everything so my readers can not click on the follow buttons, archives, and etc.

I have recopied and pasted the html code here thinking I may have tweaked a bit to much but it is still not working the way it should.

Help please before it causes me to have any more grey hairs than I already have. =)

Thanks ever so much

Felicia

SBA October 16, 2010

Hey Felicia,

I took a look and you seem to have it working now — care to share what you did?. Often if something stops working it's caused by a conflict — new theme, new button added, software/browser upgrades…

You have 3 scrollers in 2 narrow sidebars competing for readers' attention. 2 roll down and one box rolls up. Frankly, my eyes were getting crossed (lol) fixing on a target to select. Maybe you should separate them for breathing room. Great buttons though! Thanks for showcasing ours!

Vickie September 19, 2010

This is exactly what I have been looking for. I am not sure what it looks like in IE, but I am using Firefox and Safari. It seems a bit jumpy when scrolling. Is there a way to make smoother?

I appreciate any help you can give.

Vickie

SBA September 19, 2010

Vickie,

There are a couple of things you can adjust then view until you're satisfied. I suspect you need a longer scroll area so try that first:

# style="height:400px; width:130px;" – if you want a taller or shorter marquee, change the 400. the width of 130 is about the size of a button but you can widen for larger buttons. Don't go over the width of your sidebar.

*** made the same adjustment to the <div tag which was added just for Internet

or try

# scrolldelay="500" – roll will jump at this speed in milliseconds. Increase to slow down or decrease to quicken.

# scrollamount="20" – normally applies to text. 20 pixels would move each time.

Dredd iCoachDad September 4, 2010

Hi SBA,

Thank you and for this tutorial… We'll be waiting for more.

SBA September 4, 2010

Welcome Dredd!
Glad you stopped by. I assume you signed up for email delivery, that's the best way to stay connected or follow us on Twitter. Thanks

Fun On A Dime Lady June 25, 2010

Just what I was looking for! Thank you!

I just have one question…I wanted the scrolling bar to clean up the bottom of my site. Does having a lot of buttons slow the loading of my page or is it okay no matter ho many buttons I have? (I have over 12 on mine right now.)

Ishan June 25, 2010

Hello,
Having too many buttons can slow down loading of page. however, it all depends upon the image size. If size of your images is less than 50 KB(combined, it shouldn't have any effect!)
I did not get the following part:

I wanted the scrolling bar to clean up the bottom of my site.

What do you mean by "clean up bottom of site"?
Thanks for commenting.

Natalie June 14, 2010

Only half of the images are showing in the roll… what do I do??

SBA June 15, 2010

Hi Natalie

I'll take a look and see what's happening…

SBA June 15, 2010

Okay, I think this is an easy one:

In the instructions for the < marquee tag, I have

style="height:400px; width:130px;

but you have width: 75px; so change it to 130 or up to 180 or so — the limit of your sidebar. be careful some images are wider, so on the image display set the height and width of image to rescale it..

e.g this one is 219 wide:

<img src="http://i915.photobucket.com/albums/ac352/Adrienne2093/IHaveADreambutton1_edited-1.jpg"&gt;

Sheri May 25, 2010

Actually, the quotes are strait when I typed them in to comment and then when it printed on your site, they curled. I guess that is the same thing that is happening to the coding on my site???
.-= Sheri´s recent blog ..Target: Sheri’s Deal Favorites 5/23-5/29! =-.

SBA May 26, 2010

Just want to give everyone an update: The post text now shows the code addition that works on IE 8 — except for Sheri, so far. I added her code on this blog and it worked fine in IE; she added it to Blogger and it worked in IE. I suspect it's the styling in her theme. Need some more folks to 'try it out on WP. Also if anyone knows more IE tweaks feel free to say something!

Sheri May 25, 2010

My quotes look like this when I retype them:

style="height:400px; width: 130px"

Grrrrrr – No change. Are you getting tired yet?
.-= Sheri´s recent blog ..Target: Sheri’s Deal Favorites 5/23-5/29! =-.

SBA May 25, 2010

Well Sheri I think we're starting to scare the kids! Let's see if we can work this out 'behind closed doors" lol I sent you a message and got your snagged snapshot — will get back to you… Stay tuned.

Sheri May 25, 2010

I changed the first in the coding to

but the roll is still not working on IE. Any other ideas? I don't mean to be a headache, I sure appreciate your help.
.-= Sheri´s recent blog ..Target: Sheri’s Deal Favorites 5/23-5/29! =-.

SBA May 25, 2010

Isn't Html fun! Mix in a little WP and it bubbles over! WP has a nasty habit of changing quotes to the high-brow 'curly quotes' which causes Html code to hiccup!

Took an xray of your source code and found the buggers: look closely, easy to miss

style=height:400px; width:130px;”

My comment above looks fine until you copy and paste it. Welcome to my life! I solved the quotes problem in tutorial posts with a plugin aptly named, 'no-curly-quotes'.

So the short answer is retype " over both quotes in your gadget.

You may ask why I haven't updated the post text — well I will when you say "A-okay"

Sheri May 25, 2010

The problem is the Browser :cry: I use IE 8. I checked my site on Firefox and the roll looks great, I wish it looked like that on IE. Is there an adjustment so IE users can view the roll correctly or am I out of luck?

I also made the adjustment about adding buttons.

Thank you for your time.
.-= Sheri´s recent blog ..Target: Sheri’s Deal Favorites 5/23-5/29! =-.

SBA May 25, 2010

Okay, smile! We need to set the size in the div tag as well as the marquee tag — IE is just a bit fussy!! So replace the plain div with

<div style="height:400px; width:130px;">

Another reason to not like IE — the marquee tag was invented by them for slides!!!! Ugh.

Sheri May 25, 2010

Shirley,

Thank you, thank you! This is exactly what I was looking for! Your tutorials are so easy to follow. I ran into a small glitch, maybe you could help me out. I entered the coding and some blog buttons however, the roll only rolls up showing 3 buttons and stops (it doesn't roll through like the example you show above). Do you have a quick fix?

My blog roll is in the left ad column at the bottom (for now).

Sheri

.-= Sheri´s recent blog ..Target: Sheri’s Deal Favorites 5/23-5/29! =-.

SBA May 25, 2010

I looked but there are 6 buttons rolling up to 'attention Target shoppers". So I'm hoping you made an adjustment? If not what Browser do you use?

There is an error that allows the comment about adding buttons to show! I need to put a space at the end before the last 2 dashes and the end tag — otherwise editor thinks it's text! Copy and replace with this line:

<!– Add button images from this point –>

or just delete that line.

{ 2 trackbacks }

Previous post:

Next post: