WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Snippet: Random Hoverbox
  • Print
Pages: [1]   Go Down

Author Topic: Snippet: Random Hoverbox  (Read 5494 times)

Offline BlackBird

  • Posts: 2573
Snippet: Random Hoverbox
« on: August 27, 2010, 01:41:00 PM »
I have packed a simple snippet to show some random images from a folder of your choice called "Random Hoverbox".

Current version1.01
Downloadhttp://www.websitebakers.com/pages/code-snippets/listings/random-hoverbox.php?lang=EN

Usage

Just add the following call to your template:

Code: [Select]
random_hoverbox();

This uses "media" as the base directory and shows 4 random images from that dir. (Only *.jpg at the moment.)

You may give a directory and a number of images to show:

Code: [Select]
random_hoverbox( '/media/folder', 5 );

To change the appearance, edit the frontend.css.

Goodie

The script uses the file name of the image file to create the content of the alt attribute. So just name your image files like the titles you wish to use.

Example:
   Filename -> My_holidays_in_Cana da.jpg
   ALT -> "My holidays in Canada"


Update:

* The valid suffixes are now configured in the include.php. Allowed suffixes: *.jpg, *.png, *.gif
* I set the z-index for the preview image to 1000 (needed this for a page using Superfish menu)
« Last Edit: August 31, 2010, 10:52:24 AM by BlackBird »
Logged
http://wbaddons.webbird.de Don't miss this

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Droplets & Snippets »
  • Snippet: Random Hoverbox
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2