Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 18, 2013 09:20 AM by sheikhusama
Nov 24, 2012 05:30 AM|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 05:35 AM|LINK
Hope this helps
Nov 24, 2012 09:37 AM|LINK
this one help you
Nov 24, 2012 12:38 PM|LINK
Thanks for helping me.
The slider won't work - it uses a sequential list of images.
Nov 24, 2012 01:02 PM|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 02:37 PM|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 05:07 PM|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 06:54 AM|LINK
I have tried to answer to your question with this post:
An enhanced WebMatrix Bakery template.
Hope it helps.
Nov 28, 2012 02:16 AM|LINK
Where do you people keep finding these gems???
Jan 18, 2013 09:20 AM|LINK
this is your web http://bxslider.com/