Thanks
With Regards
Abhishek Rajiv Luv
"Helpful then please Mark as Answer"
http://www.codeabstract.com/
http://pluralsight.com/training/users/abhishekluv
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.
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
baginska
Member
18 Points
30 Posts
Bakery Template - Sliding Images
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.
Thank you
Abhishek Luv
Participant
1746 Points
468 Posts
Re: Bakery Template - Sliding Images
Nov 24, 2012 05:35 AM|LINK
Hi Dear
Hope this helps
http://bxslider.com/
With Regards
Abhishek Rajiv Luv
"Helpful then please Mark as Answer"
http://www.codeabstract.com/
http://pluralsight.com/training/users/abhishekluv
sheikhusama
Member
8 Points
5 Posts
Re: Bakery Template - Sliding Images
Nov 24, 2012 09:37 AM|LINK
this one help you jQuery
baginska
Member
18 Points
30 Posts
Re: Bakery Template - Sliding Images
Nov 24, 2012 12:38 PM|LINK
Thanks for helping me.
The slider won't work - it uses a sequential list of images.
How can I use @razor/javascript to randomly change the images?
(newbie)
Thanks
<ul class="bxslider">
<li> <img src="/images/pic1.jpg" /></li>
<li><img src="/images/pic2.jpg" /></li>
<li><img src="/images/pic3.jpg" /></li>
<li><img src="/images/pic4.jpg" /></li>
</ul>
wavemaster
Participant
1279 Points
1127 Posts
Re: Bakery Template - Sliding 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
display it
baginska
Member
18 Points
30 Posts
Re: Bakery Template - Sliding Images
Nov 24, 2012 02:37 PM|LINK
Okay, below the razor code pulls a random filename reference from the Bakery table.
I could use javascript setInterval to pull another filename reference and display it but
HOW do I reference the code below so Javascript knows what to run? For example: var timerID = setInterval( RazorCode, 300000);
Thank you.
@{
Page.Title = "Home";
var db = Database.Open("Bakery");
var products = db.Query("SELECT * FROM PRODUCTS").ToList();
var featured = products[new Random().Next(products.Count)];
}
<div id="featuredProduct">
<a href= "/Order/@featured.Id" title="Order @featured.Name"> <img alt="Featured Product" src="~/Images/Products/@featured.ImageName"/>
</a>
Afzaal.Ahmad...
Contributor
2661 Points
1040 Posts
Re: Bakery Template - Sliding Images
Nov 24, 2012 05:07 PM|LINK
www.w3schools.com/jquery/default.asp
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.
~~! FIREWALL !~~
GmGregori
Contributor
5470 Points
737 Posts
Re: Bakery Template - Sliding Images
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.
baginska
Member
18 Points
30 Posts
Re: Bakery Template - Sliding Images
Nov 28, 2012 02:16 AM|LINK
Where do you people keep finding these gems???
Thank you
thank you
thank you!!!
sheikhusama
Member
8 Points
5 Posts
Re: Bakery Template - Sliding Images
Jan 18, 2013 09:20 AM|LINK
this is your web http://bxslider.com/