PDA

View Full Version : jquery script problem.


ohk
10-18-2012, 06:42 AM
How to make the scroll news continuous slide?
How to make it after the third news slide continous with first news.
http://bit.ly/V94GOG

Here the script

drupal_add_css(drupal_get_path('module', 'newsticker') .'/newsticker.css');
drupal_add_js(drupal_get_path('module', 'newsticker') .'/jquery.scrollTo.js');
drupal_add_js(drupal_get_path('module', 'newsticker') .'/jquery.serialScroll.js');
drupal_add_js("jQuery(function( $ ) {
var width = $('#newsticker').parent().width();
$('li.newsticker-item, #newsticker').width(width);
$('#newsticker ul').width(width*10);
$('#newsticker').serialScroll({
items: 'li',
start: 0,
force: true,
step: 1,
axis:'x',
cycle: ". variable_get('newsticker_continous', 1) .",
interval: ". variable_get('newsticker_timeout', 1000) .",
duration: ". variable_get('newsticker_speed', 1000) ."
});
". $pause ."});", 'inline');

$output = '';
while ($item = db_fetch_array($result)) {
if (trim($item['link']) != '' )
$content = '<a href="'. $item['link'] .'">'. $item['title'] .'</a>';
else
$content = $item['title'];

$output .= '<li class="newsticker-item">'. $content .'</li>';
}
return '<div id="newsticker"><ul>'. $output .'</ul></div>';
}
}

edbr
10-18-2012, 07:50 AM
I have moved this to the javascript and frameworks forum