Presentation is loading. Please wait.

Presentation is loading. Please wait.

Images in HTML Images in the foreground –src loaded separately; relative to home directory –Width & height set aside space in page; do not use this to.

Similar presentations


Presentation on theme: "Images in HTML Images in the foreground –src loaded separately; relative to home directory –Width & height set aside space in page; do not use this to."— Presentation transcript:

1 Images in HTML Images in the foreground –src loaded separately; relative to home directory –Width & height set aside space in page; do not use this to reduce images! –Alt for web readers Images in the background –Background-image –Background-repeat –Background-position

2 Image Maps Indicate a map for the image Define the map, with areas for links

3 Image Sprites Putting multiple images in 1 file reduces download times Create links Use CSS to show 1 at a time #navlist li, #navlist a{height:44px;display:block;} #home{left:0px;width:46px; #home{background:url('img_navsprites_hover.gif') 0 0;} #home a:hover{background: url('img_navsprites_hover.gif') 0 - 45px;}

4 Image Slideshow with CSS Put all your images in a single image Show animation in a div with no overflow #slideshow { overflow: hidden; } Put a div in that, where background is animated #slideshow div { background: url("myshow.jpg") 0 0; height: 200px; width: 1000px; position:absolute; top:0; left:0; animation: myslideshow 60s linear infinite; -webkit-animation: myslideshow 60s linear infinite; -moz-animation: myslideshow 60s linear infinite; }

5 CSS Slideshow (con't) Define animations –animation-name –animation-duration –animation-timing-function Define keyframes @keyframes myslideshow { 0% {left: 0px;} 100% {left: 200%;} } @-webkit-keyframes myslideshow { 0% {left: 0px;} 100% {left: 200%;} }

6 Image Slideshow with jQuery The animate method changes a selector's styles over time (selector).animate({styles},speed,easing,callback) –Property names are "camel-cased" –Speed in milliseconds (400 default) –Easing: swing (default) vs. linear –Callback is executed after animation completes The fade method allows a selector to fade in or out over a specified timeframe (selector).fadeIn(speed,callback) (selector).fadeOut(speed,callback)


Download ppt "Images in HTML Images in the foreground –src loaded separately; relative to home directory –Width & height set aside space in page; do not use this to."

Similar presentations


Ads by Google