update template

This commit is contained in:
rulingcom 2021-12-28 07:51:50 +00:00
parent a453ed717d
commit cbe2f768b6
4 changed files with 27 additions and 33 deletions

View File

@ -128,7 +128,7 @@
num=1; num=1;
} }
var flag=false; var flag=false;
$('.btn-left').click(function(){ $('[data-subpart-id=\"{{subpart-id}}\"] .btn-left').click(function(){
if(!flag){ if(!flag){
var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').toArray(); var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').toArray();
var ul_length = uls.length; var ul_length = uls.length;
@ -147,7 +147,7 @@
$('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list.active').eq(0).effect("slide", { direction: "left", mode: 'show', duration: 500},function(){$("body").css("overflow-x","");flag=false;}); $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list.active').eq(0).effect("slide", { direction: "left", mode: 'show', duration: 500},function(){$("body").css("overflow-x","");flag=false;});
}; };
}); });
$('.btn-right').click(function(){ $('[data-subpart-id=\"{{subpart-id}}\"] .btn-right').click(function(){
var lilength = $('[data-subpart-id=\"{{subpart-id}}\"] li.w-annc__item').length; var lilength = $('[data-subpart-id=\"{{subpart-id}}\"] li.w-annc__item').length;
if(!flag){ if(!flag){
var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').toArray(); var uls = $('[data-subpart-id=\"{{subpart-id}}\"] ul.w-annc__list:not(.hidden_item)').toArray();

View File

@ -3,35 +3,29 @@
<li>{{content}}</li> <li>{{content}}</li>
</ul> </ul>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
(function(){ (function(){
var main_div = $("div[data-subpart-id={{subpart-id}}]"), var main_div = $("div[data-subpart-id={{subpart-id}}]"),
total_texts = main_div.find("ul li").length - 1, total_texts = main_div.find("ul li").length - 1,
current_text = 0, current_text = 0,
last_text = 0; last_text = 0,
speed = 3000;
main_div.find("ul li").hide(); main_div.find("ul li").hide();
var textTransform = function(){ function textTransform(){
current_text++;
current_text = (current_text > total_texts ? 0 : current_text); current_text = (current_text > total_texts ? 0 : current_text);
last_text = (current_text == 0 ? total_texts : current_text - 1); last_text = (current_text == 0 ? total_texts : current_text - 1);
speed = $('.marquee > li > a').eq(current_text).attr('speed'); speed = main_div.find("ul li").eq(current_text).find("> a").eq(0).attr('speed');
main_div.find("ul li").eq(last_text).slideUp(500); main_div.find("ul li").eq(last_text).stop(true, true).slideUp({duration: 500, queue: true});
main_div.find("ul li").eq(current_text).slideDown(500); main_div.find("ul li").eq(current_text).stop(true, true).slideDown({duration: 500, queue: true});
current_text++;
if(total_texts > 0){ if(total_texts > 0){
setTimeout(textTransform,speed); if(window["{{subpart-id}}_time_out_id"])
clearTimeout(window["{{subpart-id}}_time_out_id"]);
window["{{subpart-id}}_time_out_id"] = setTimeout(textTransform,speed);
} }
return;
} }
setTimeout(textTransform,500); textTransform();
})(); })();
</script> </script>
<script type="text/javascript">
(function(){
var main_div = $("div[data-subpart-id"{{subpart-id}})
}
</script>

View File

@ -1,12 +1,12 @@
{ {
"widgets" : [ "widgets" : [
{ {
"filename" : "widget", "filename" : "widget",
"name" : { "name" : {
"zh_tw" : "跑馬燈", "zh_tw" : "跑馬燈",
"en" : "marquee" "en" : "marquee"
}, },
"thumbnail" : "thumb.png" "thumbnail" : "thumb.png"
} }
] ]
} }

View File

@ -13,7 +13,7 @@
<%= javascript_include_tag "plugin/picturefill.min.js"%> <%= javascript_include_tag "plugin/picturefill.min.js"%>
<%= javascript_include_tag "plugin/jquery.mobile.custom.min.js"%> <%= javascript_include_tag "plugin/jquery.mobile.custom.min.js"%>
<%= javascript_include_tag "bootstrap.min"%> <%= javascript_include_tag "bootstrap.min"%>
<%= javascript_include_tag "bootstrap.min"%>
<%= javascript_include_tag "plugin/jquery.cycle2.video.min.js"%> <%= javascript_include_tag "plugin/jquery.cycle2.video.min.js"%>
<%= javascript_include_tag "plugin/jquery-bullseye-min.js"%> <%= javascript_include_tag "plugin/jquery-bullseye-min.js"%>