Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 26, 2012, 12:29:02 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Interested in joining the WebsiteBaker team?
For more Information read
here
or on our
new website
.
155536
Posts in
21712
Topics by
7736
Members
Latest Member:
chris85
WebsiteBaker Community Forum
English
Templates, Menus & Design
(Moderator:
Argos
)
Need help with background image slideshow
Pages: [
1
]
Go Down
Author
Topic: Need help with background image slideshow (Read 379 times)
hep
Offline
Posts: 1
Need help with background image slideshow
«
on:
October 21, 2010, 02:18:18 AM »
I already have some "random background" code that pulls random images from a media folder, but I'd like for it to cycle through all of the images in the folder like a slide show, instead of only loading different background images each time the page loads. Any suggestions? Here's the code I currently have:
$folder=opendir(WB_PATH.MEDIA_DIREC
TORY.'/'.$dir.'/.');
$names = array();
while ($file = readdir($folder)) {
$ext=strtolower(substr($file,-4));
if ($ext==".jpg"||$ext==".gif"||$ext==".png"){
$names[count($names)] = $file;
}
}
closedir($folder);
shuffle($names);
$image=$names[0];
$name=substr($image,0,-4);
$return_img = 'style="background: transparent url(\''.WB_URL.MEDIA_DIREC
TORY.'/'.$dir.'/'.$image.'\') no-repeat;"';
return $return_img;
Logged
Ruud
WebsiteBaker Org e.V.
Offline
Posts: 2296
Re: Need help with background image slideshow
«
Reply #1 on:
October 21, 2010, 08:31:48 AM »
A webserver and PHP code will never rotate your images automatically.
You will need to add some extra javascript logic in there.
There are many solutions for doing that.
Maybe the
captionslider
module is something for you.
Logged
Professional WebsiteBaker Solutions
Pages: [
1
]
Go Up
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> WebsiteBaker Website Showcase
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> WebsiteBaker 2.9
===> Announcements
===> Help/Support
=====> Modules / Extensions
===> Suggestions
===> Software bugs
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> WebsiteBaker 2.9
===> Ankündigungen
===> Hilfe/Support
=====> Module / Extensions
===> Vorschläge
===> Softwarefehler
===> Erfahrungs und Testberichte
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
-----------------------------
Bakery (WB shop module)
-----------------------------
=> Bakery English
=> Bakery Deutsch
-----------------------------
KeepInTouch (Multi Contact Module)
-----------------------------
=> KeepInTouch English
=> KeepInTouch Deutsch
Loading...