$(e.target).attr('id'); 取得該element attribute id的值
window.location 連到後面的url
$('#today').attr({class:"TabbedPanelsTab"});
把id為today 的element 裡面的attribute class 值變為 TabbedPanelsTab
$('#TabbedPanelsTab').bind('click', link_to);
把id為TabbedPanelsTab的element event 綁上 link_to
[script type="text/javascript"]
(function($){
function link_to(e) {
var id = $(e.target).attr('id');
window.location = "http://yhd.icetech.com.tw:20503/user/"+id+"/<%= params[:sort]%>/<%= params[:type]%>";
})
}
$(document).ready(function() {
$('#today').attr({class:"TabbedPanelsTab"});
$("#<%= params[:during] %>").attr({class:"TabbedPanelsTab TabbedPanelsTabSelected"});
$('.TabbedPanelsTab').bind('click', link_to);
})
})(jQuery);
[/script]
沒有留言:
張貼留言