Hi I have a problem I have a code example code below:
<div class="fadein">
<img src="banner1.jpg" width="645" height="300"/>text 1
<img src="banner2.jpg" width="645" height="300"/>text 2
<img src="banner3.jpg" width="645" height="300"/>text 3
<img src="banner3.jpg" width="645" height="300"/>text 4
</div>
which is rendered by a php script is there any way I could add li/li on each image and text using javascript ex.
<li><img src="banner1.jpg" width="645" height="300"/>text 1</li>
<li><img src="banner2.jpg" width="645" height="300"/>text 2</li>
I am trying to use simple jquery slideshow on it but the text won't join the image when fading in and fading out, may be with the li I could use another slide show effect
any idea thanks.
I have no control/idea on the php.
Guys heres the source code for your script
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js">
</script>
<script type="text/javascript">
$(document).ready(function() { var i = 0,
imgTxt = $('.fadein').text().trim ().split('\n'),
wrapedImgs = $('.fadein').children().map(function() {
var tmp = '<img src="' + this.src + '" width="' + this.width + '"
height="' + this.height + '" />' + imgTxt[i]; i += 1; return
tmp; }).get().join('</li><li>'); $('.fadein').html('<ul><li>' + wrapedImgs
+ '</li></ul>'); });
</script>
</head>
<body>
<div class="fadein"> <img src="banner1.jpg" width="645" height="300"/>text 1
<img src="banner2.jpg" width="645" height="300"/>text 2 <img src="banner3.jpg"
width="645" height="300"/>text 3 <img src="banner3.jpg" width="645"
height="300"/>text 4 </div>
</body>
</html>
<li>be inside a<ul>?