Announcement Announcement Module
Collapse
No announcement yet.
Rotating banners Page Title Module
Move Remove Collapse
Search Search Module
Collapse

Advertisement Advertisement Module
Collapse

Latest Topics Latest Topics Module
Collapse

  • HotButton
    Reply to GDF's Portfolios
    HotButton
    Some impressive work for big-name clients there. Love the GFOS stuff especially. Site works well for the most part, but a couple links misdirect. Example: Clicking the the Shock Absorber Order Card lands...
    Today, 03:34 PM
  • PrintDriver
    Reply to Graphic design dissertation questions
    PrintDriver
    This is very telling:


    The professor wants you to do an analysis of some aspect of design.
    It sounds like the same old same old junk like "Psychology of color in product...
    Today, 03:33 PM
  • ISitude
    Reply to Graphic design dissertation questions
    ISitude
    I agree with your teacher's position and critical remarks.



    PD's comment is I think the correct approach ...and would of been the way I'd proceed according to her instruction/rule(s)...
    Today, 03:16 PM
  • CarrotOnAStick
    Reply to Graphic design dissertation questions
    CarrotOnAStick
    and i just found the letter there in a box in the back of the attic, it said The proposal is too short and does not address all heading required in the brief, the topic is very vague - you must do substantial...
    Today, 03:06 PM
  • CarrotOnAStick
    Reply to Graphic design dissertation questions
    CarrotOnAStick
    I've spent the past 2 days tearing my bedroom apart looking for it because my sister got married at the start of this month which meant the entire house had to be cleaned top to bottom meaning the letter...
    Today, 02:51 PM

X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rotating banners

    Hi,

    I am looking to have the banners on this website at the top of the page change every-time the page is refreshed,

    http://www.jhooakley.com/

    Is there an easy way to do this... Bearing in mind web coding is not my fortay.



    Thanks!
    Richard Lock Artwork for Music and Media DEVOLUTION DESIGNS - CLICK HERE

    Type One Creative, graphic and web design services in the UK TYPE ONE CREATIVE - CLICK HERE

  • #2
    You can do it with PHP or Javascript. The dead easiest way to do it is to number your images, like banner1.jpg banner2.jpg banner3.jpg and have JS or PHP choose a random number between 1 and 3.

    PHP I'd favor because it'll work before the page is loaded and if JS is turned off.

    Code:
    <img src="/img/banner<?php echo rand(1,3); ?>.jpg" alt="">
    Swedish Meatball Pornography

    Comment


    • #3
      Thanks!
      Richard Lock Artwork for Music and Media DEVOLUTION DESIGNS - CLICK HERE

      Type One Creative, graphic and web design services in the UK TYPE ONE CREATIVE - CLICK HERE

      Comment


      • #4
        i ma still struggling with this.. cant get swf files to rotate..

        is there a decent guide online for this?

        thanks
        Richard Lock Artwork for Music and Media DEVOLUTION DESIGNS - CLICK HERE

        Type One Creative, graphic and web design services in the UK TYPE ONE CREATIVE - CLICK HERE

        Comment


        • #5
          try this website to code a simple on with php:

          http://jwpctips.com/internet/how-mak...cript-php.html

          Comment


          • #6
            http://www.developertutorials.com/sc...tails/7679.php
            Broke or just cheap? Read my list of free open source alternatives to Adobe Creative Suite software.

            Comment


            • #7
              still none the wiser!!! lol.
              Just cant get them to work at all. I can get giffs to rotate but not SWf files


              I just need some code i can copy an paste if possible.
              Richard Lock Artwork for Music and Media DEVOLUTION DESIGNS - CLICK HERE

              Type One Creative, graphic and web design services in the UK TYPE ONE CREATIVE - CLICK HERE

              Comment


              • #8
                Post all the code for the page including the PHP.

                Comment


                • #9
                  Code:
                  <?php 
                  
                  /* files to rotate */
                  $files = array('aaa.gif','bbb.gif','ccc.gif','ddd.swf','fgtr.swf');
                  
                  /* current file */
                  $file = isset($_COOKIE['file']) && in_array($_COOKIE['file'],$files)?$_COOKIE['file']:null;
                  
                  /* remove previous file shown */
                  if($file !== null) {
                  	$filesIndex = array_search($file,$files);
                  	array_splice($files,$filesIndex,1);
                  }
                  
                  /* choose a new file to show */
                  $filesIndex = array_rand($files,1);
                  $file = $files[$filesIndex];
                  
                  // save file to cookie
                  setcookie('file',$file);
                  
                  // get the files extension to determine how to show it
                  $filesExtension = strrpos($file,'.') === false?'':substr($file,(strrpos($file,'.')+1));
                  
                  // alternate display implementation for an image and swf
                  switch($filesExtension) {
                  	case 'swf':
                  		echo "<p>Showing Flash: $file</p>";
                  		break;
                  	
                  	default:
                  		echo "<p>Showing Image: $file</p>";
                  }
                  ?>
                  Test it out to see what it does and let me know if that is what your after.

                  If it is then I'll show you next step once your code is posted.
                  Last edited by tZ; 11-03-2009, 11:00 PM.

                  Comment


                  • #10
                    thanks if this works i owe you one! .. or two!
                    Richard Lock Artwork for Music and Media DEVOLUTION DESIGNS - CLICK HERE

                    Type One Creative, graphic and web design services in the UK TYPE ONE CREATIVE - CLICK HERE

                    Comment

                    Mediabistro A division of Prometheus Global Media home | site map | advertising/sponsorships | careers | contact us | help courses | browse jobs | freelancers | content | member benefits | reprints & permissions terms of use | privacy policy Copyright © 2015 Mediabistro Inc.
                    Working...
                    X