Last post Jan 18, 2013 05:20 AM by sheikhusama
Nov 24, 2012 01:30 AM|baginska|LINK
Hi, everyone, Using the WebMatrix Bakery Template - I want to be able to slide or fade the main image with
a random product image... say every 3 seconds.
I apprecate your help.
Nov 24, 2012 01:35 AM|Abhishek Luv|LINK
Hope this helps
Nov 24, 2012 05:37 AM|sheikhusama|LINK
this one help you
Nov 24, 2012 08:38 AM|baginska|LINK
Thanks for helping me.
The slider won't work - it uses a sequential list of images.
Nov 24, 2012 09:02 AM|wavemaster|LINK
put all your pictures references in a table: let's say you have population of 100
generate a random number between 1 and 100
massage the random number so the end result is a whole number between 1 and 100
use that number to pull the picture reference from the table
Nov 24, 2012 10:37 AM|baginska|LINK
Okay, below the razor code pulls a random filename reference from the Bakery table.
Page.Title = "Home";
var db = Database.Open("Bakery");
var products = db.Query("SELECT * FROM PRODUCTS").ToList();
var featured = products[new Random().Next(products.Count)];
<a href= "/Order/@featured.Id" title="Order @featured.Name"> <img alt="Featured Product" src="~/Images/Products/@featured.ImageName"/>
Nov 24, 2012 01:07 PM|Afzaal.Ahmad.Zeeshan|LINK
You can use jQuery to change the image with the main image. Also there is an attribute to set the time for changing sliding fading too. You will learn some of them in this tutorial.
Nov 27, 2012 02:54 AM|GmGregori|LINK
I have tried to answer to your question with this post:
An enhanced WebMatrix Bakery template.
Hope it helps.
Nov 27, 2012 10:16 PM|baginska|LINK
Where do you people keep finding these gems???
Jan 18, 2013 05:20 AM|sheikhusama|LINK
this is your web http://bxslider.com/