Philgenius
New Member
- Joined
- Jun 13, 2012
- Messages
- 9
- Reaction score
- 0
I can't code da slide show of images please help guys!!!
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
I can't code da slide show of images please help guys!!!
You can use jquery's scrollable function.
It's very easy, this is a basic way.
!! Remember to add this jquery library to the html !!
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
*html*
<div class="scrollable">
<div class="items">
<div>scroll me first</div>
<div>scroll me second</div>
</div>
</div>
*css*
.scrollable {
position:relative;
overflow:hidden;
width: 75.000em;
height:250px;
}
.scrollable .items {
/* this cannot be too large */
width: 20000em;
position:absolute;
}
.items div {
float:left;
width: 75em;
}
*javascript* add this to the bottom of your html
<script>
$(function() {
$(".scrollable").scrollable({speed: 2000, circular: true, effect: 'fade'}).autoscroll({ autoplay: true });
});
</script>
<!DOCTYPE html>
<html>
<head>
<!-- This adds the jquery library to your html page -->
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>
<!-- This is the styling -->
<style>
/*Styling for the entire scrollable class*/
.scrollable {
position:relative;
overflow:hidden;
width: 75.000em; /*width of the scrollable div, you can change this to pixels, just remember to convert, will be something like 900px*/
height:250px;
}
/*This styles the div wrapping the items that'll be scrolling*/
.scrollable .items {
width: 20000em; /*this is potentially the width of all items next to each other, but dont let this worry you yet*/
position:absolute;
}
/*This styles the items*/
.items div {
float:left; /*the aligns all items next to each other*/
width: 75em; /*this will be the width of each item scrolling*/
}
</style>
</head>
<body>
<div class="scrollable">
<div class="items">
<!-- These divs in sequence will be the order of the scrolling -->
<div>Add something in here, a image or whatever</div>
<div>You can also add something in here, whatever you feel like.</div>
</div>
</div>
<!-- javascript -->
<script>
$(function() {
// This handles the scrolling, effects have been added
$(".scrollable").scrollable({speed: 2000, circular: true, effect: 'fade'}).autoscroll({ autoplay: true });
});
</script>
</body>
</html>
Devsign which part of html do I code? En can u please re-type da code clearly coz it looks complicated..tnx 4 ur help
Devsign which part of html do I code? En can u please re-type da code clearly coz it looks complicated..tnx 4 ur help