Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Sep 2012
    Posts
    47
    Thanks
    13
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • Users who have thanked Excavator for this post:

    themoon (01-10-2013)

  • #3
    New Coder
    Join Date
    Sep 2012
    Posts
    47
    Thanks
    13
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • #5
    New Coder
    Join Date
    Sep 2012
    Posts
    47
    Thanks
    13
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,623
    Thanks
    0
    Thanked 645 Times in 635 Posts
    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/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    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

  • Users who have thanked Excavator for this post:

    themoon (01-14-2013)

  • #8
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,623
    Thanks
    0
    Thanked 645 Times in 635 Posts
    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/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #9
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    You are definitely the .js guy felgall, I only put it there because of this bit in the article you wrote:

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •