EV004/modules/text_marquee/_widget.html.erb

39 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

2023-07-17 10:56:11 +00:00
<div class="marquee-1" module="text_marquee" data-ps="">
<ul class="marquee" data-level="0" data-list="texts">
<li>{{content}}</li>
</ul>
</div>
<script type="text/javascript">
(function(){
var main_div = $("div[data-subpart-id={{subpart-id}}]"),
total_texts = main_div.find("ul li").length - 1,
current_text = 0,
last_text = 0;
main_div.find("ul li").hide();
var textTransform = function(){
current_text++;
current_text = (current_text > total_texts ? 0 : current_text);
last_text = (current_text == 0 ? total_texts : current_text - 1);
speed = $('.marquee > li > a').eq(current_text).attr('speed');
main_div.find("ul li").eq(last_text).slideUp(500);
main_div.find("ul li").eq(current_text).slideDown(500);
if(total_texts > 0){
setTimeout(textTransform,speed);
}
}
setTimeout(textTransform,500);
})();
</script>
<script type="text/javascript">
(function(){
var main_div = $("div[data-subpart-id"{{subpart-id}})
$('.marquee li a').attr('title','marquee');
}
</script>