PDA

View Full Version : problem in crawler



brakat
03-15-2013, 04:36 PM
1) Script Title: I have installed 'Text and Image Crawler'.

2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...wler/index.htm

3) Describe problem: i installed this in my website in this link "http://almoltaqa.com.eg/beta/en/index.html" the items go over itselfs check it and you will understand what i mean

Beverleyh
03-15-2013, 07:12 PM
I dont see the script-call on the page - should look something like this;
<script type="text/javascript">
marqueeInit({
uniqueid: 'mycrawler2',
style: {
'padding': '5px',
'width': '450px',
'background': 'lightyellow',
'border': '1px solid #CC3300'
},
inc: 5, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 150,
persist: true,
savedirection: true
});
</script>

Your div is also empty - you have;
<div class="marquee" id="mycrawler2">
</div>You should have;
<div class="marquee" id="mycrawler2">
<img src="http://img42.imageshack.us/img42/6331/beachgl.jpg" /> <img src="http://img222.imageshack.us/img222/8854/waterox.jpg" /> <img src="http://img405.imageshack.us/img405/7314/cocovv.jpg" /> <img src="http://img853.imageshack.us/img853/5038/bonsaiy.jpg" />
</div>Please refer to the script demo page and review the installation instructions: http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm

jscheuer1
03-16-2013, 06:19 AM
.

Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.


<script type="text/javascript" src="../js/crawler.js"></script>

should be:


<script type="text/javascript" src="../js/crawler.js">

/* Text and/or Image Crawler Script v1.53 (c)2009-2011 John Davenport Scheuer
as first seen in http://www.dynamicdrive.com/forums/
username: jscheuer1 - This Notice Must Remain for Legal Use
*/

</script>

If you're worried about the comment not validating, it is valid. But the validator doesn't agree. You can do it like so:


<script type="text/javascript" src="../js/crawler.js">

// Text and/or Image Crawler Script v1.53 (c)2009-2011 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use

</script>

That said, it looks OK in Opera and Chrome. In IE 10 the images are each only 1px wide. Here, in the almoltaqa.com.eg/beta/js/main.js file:


$.ajax({
url: '../helper/siteHandler.php',
data: {action:"getCompanies"},
dataType:"json",
success: function(data) {

str = '';
$.each(data, function(k,v){
str+= '<a href="'+v.com_link+'" style="margin:5px 10px" target="_blank"><img width=auto height="51" src="../uploaded/logos/'+v.com_pic+'" title="'+v.com_name+'"/></a>' ;
});
//alet(str);
$("#mycrawler2").html(str);

marqueeInit({
uniqueid: 'mycrawler2',
style: {
'padding': '2px',


},
inc: 5, //speed - pixel increment for each iteration of this marquee's movement
mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
moveatleast: 2,
neutral: 150,
savedirection: true,
random: true
});

}

});

Let's zoom in on the above highlighted line:


str+= '<a href="'+v.com_link+'" style="margin:5px 10px" target="_blank"><img width=auto height="51" src="../uploaded/logos/'+v.com_pic+'" title="'+v.com_name+'"/></a>' ;

See the width and height? Using auto there is invalid. To get the effect I'm sure you're after, use css style instead:


str+= '<a href="'+v.com_link+'" style="margin:5px 10px" target="_blank"><img style="width: auto; height: 51px" src="../uploaded/logos/'+v.com_pic+'" title="'+v.com_name+'"/></a>' ;

The browser cache may need to be cleared and/or the page refreshed to see changes.