Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-10-2013, 07:24 PM   PM User | #1
themoon
New Coder

 
Join Date: Sep 2012
Posts: 46
Thanks: 13
Thanked 0 Times in 0 Posts
themoon is an unknown quantity at this point
Does this have to be php or way to do this in html?

Is there a way to display random images about every 5 seconds from a specific folder in html without specifying their actual names in html?

So instead of having to type every single <src img= picture 1.jpg>
just tell it to display every image in this folder every few seconds?

Does this make sense?
themoon is offline   Reply With Quote
Old 01-10-2013, 07:31 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello themoon,
Look at this jQuery plugin - http://www.slidesjs.com/

That's just the first one google turned up. Search 'jQuery slideshow' for lots more.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
themoon (01-10-2013)
Old 01-10-2013, 07:32 PM   PM User | #3
themoon
New Coder

 
Join Date: Sep 2012
Posts: 46
Thanks: 13
Thanked 0 Times in 0 Posts
themoon is an unknown quantity at this point
oh man, thank heavens. Appreciate the reply!

Hmm... does jquery require being connected to the internet? These are stand alone html boxes on digital display tv's.

Last edited by themoon; 01-10-2013 at 07:45 PM..
themoon is offline   Reply With Quote
Old 01-10-2013, 08:10 PM   PM User | #4
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by themoon View Post
oh man, thank heavens. Appreciate the reply!

Hmm... does jquery require being connected to the internet? These are stand alone html boxes on digital display tv's.
To be stand-alone you would need to include the .jQuery file that runs the slideshow and the jQuery library itself. Very easy.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 01-10-2013, 08:44 PM   PM User | #5
themoon
New Coder

 
Join Date: Sep 2012
Posts: 46
Thanks: 13
Thanked 0 Times in 0 Posts
themoon is an unknown quantity at this point
I know this is a dumb question...

But I can't find the "file" you speak of. I am on the site. I see download.

When I click on the button for Download (production) .jQuery a bunch of code comes up that looks jumbled.
When I click on the button for Download (development) .jQuery a bunch of code comes up that looks clean.

Am I supposed to like... copy and paste this code into a txt file or something.

EDIT:

Ok, skip that, I think I figured it out. Create a .js doc, copy and paste the code. Now need to figure out how to link a jquery slideshow to it. Thank you for indulging me!

Last edited by themoon; 01-10-2013 at 08:53 PM..
themoon is offline   Reply With Quote
Old 01-10-2013, 09:56 PM   PM User | #6
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
If you are going to use jQuery on the internet then you should link to one of the main shared copies so that it is more likely that your visitors will already have it downloaded instead of having it slow down the loading of your page.

The following is probably the most commonly used alternative:

Code:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 01-10-2013, 10:41 PM   PM User | #7
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Quote:
Originally Posted by themoon View Post
Ok, skip that, I think I figured it out. Create a .js doc, copy and paste the code. Now need to figure out how to link a jquery slideshow to it. Thank you for indulging me!
For that slideshow I linked you to in my first reply you would need these files to be available locally to work with no internet connection:
  1. slides.js
  2. jquery-1.8.3.min.js

The head of your document could start out looking something like this -
Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>	
	<script src="path/to/jquery-1.8.3.min.js"></script>
	<script src="path/to/slides.js"></script>
	<script>
		$(function(){
			$('#slides').slides({
				preload: true,
				preloadImage: 'img/loading.gif',
				play: 5000,
				pause: 2500,
				hoverPause: true
			});
		});
	</script>
</head>
<body>
</body>
</html>
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
themoon (01-14-2013)
Old 01-10-2013, 11:04 PM   PM User | #8
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,465
Thanks: 0
Thanked 499 Times in 491 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
You put the script tags in the wrong place. To have the page appear to load faster any script tags should come immediately before the </body> tag.

The only time script tags should go in the head of the page is where the script might transfer to another page instead of loading the current one.
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is offline   Reply With Quote
Old 01-10-2013, 11:16 PM   PM User | #9
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
You are definitely the .js guy felgall, I only put it there because of this bit in the article you wrote:

Quote:
The next thing to check for is any code that you want to ensure gets executed before the page gets loaded (eg. a test for if your non-frames page is loading inside someone's frameset). This code needs to be in a script within the head section of your page below the title and any meta tags and link statements.
Actually, according to that, maybe only the preload script would belong in the head.

Some very good information there if you're interested themoon, see the article here.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:07 PM.


Advertisement
Log in to turn off these ads.