javascript - Hover function does not work in Google Chrome when using jQuery-1.7.2.min.js -
i use adminlte template create admin page. encounter problems included jquery source. have part of function nested sort refer jquery-1.7.2.min.js work. runs okay in firefox, when try run in google chrome, sidebar hover function not work. tried replace original template jquery jqyery-2.0.2.min.js, after hover function work, nested sort function no longer works. there can differentiate 2 jquery functions?
here sample code. have nested sort function :
<!-- nested sequence reference--> <script type="text/javascript" src="js2/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="js2/jquery-ui-1.8.16.custom.min.js"></script> <script type="text/javascript" src="js2/jquery.ui.touch-punch.js"></script> <script type="text/javascript" src="js2/jquery.mjs.nestedsortable.js"></script> <!-- sequence script--> <script> $(document).ready(function(){ $('ol.sortable').nestedsortable({ forceplaceholdersize: true, handle: 'div', helper: 'clone', items: 'li', opacity: .6, placeholder: 'placeholder', revert: 250, tabsize: 25, tolerance: 'pointer', toleranceelement: '> div', maxlevels: 1, istree: false, expandonhover: 700, startcollapsed: true }); //independent content sequence $('#toindependenthierarchy').click(function(e){ //hiered = $('ol.sortable').nestedsortable('tohierarchy', {startdepthcount: 0}); //hiered = dump(hiered); //(typeof($('#tohierarchyoutput')[0].textcontent) != 'undefined') ? //$('#tohierarchyoutput')[0].textcontent = hiered : $('#tohierarchyoutput')[0].innertext = hiered; //add try update database function jquery serialized = $('ol.sortable').nestedsortable('serialize'); $.post( "independentbannersequence.php", serialized, function( data ) { alert( data ); }); return false; }) //master content sequence $('#tomasterhierarchy').click(function(e){ //hiered = $('ol.sortable').nestedsortable('tohierarchy', {startdepthcount: 0}); //hiered = dump(hiered); //(typeof($('#tohierarchyoutput')[0].textcontent) != 'undefined') ? //$('#tohierarchyoutput')[0].textcontent = hiered : $('#tohierarchyoutput')[0].innertext = hiered; //add try update database function jquery serialized = $('ol.sortable').nestedsortable('serialize'); $.post( "masterbannersequence.php", serialized, function( data ) { alert( data ); }); return false; }) $('#toarray').click(function(e){ //arraied = $('ol.sortable').nestedsortable('toarray', {startdepthcount: 0}); arraied = $('ol.sortable').nestedsortable('toarray', {startdepthcount: 0}); arraied = dump(arraied); (typeof($('#toarrayoutput')[0].textcontent) != 'undefined') ? $('#toarrayoutput')[0].textcontent = arraied : $('#toarrayoutput')[0].innertext = arraied; }) }); function dump(arr,level) { var dumped_text = ""; if(!level) level = 0; //the padding given @ beginning of line. var level_padding = ""; for(var j=0;j<level+1;j++) level_padding += " "; if(typeof(arr) == 'object') { //array/hashes/objects for(var item in arr) { var value = arr[item]; if(typeof(value) == 'object') { //if array, dumped_text += level_padding + "'" + item + "' ...\n"; dumped_text += dump(value,level+1); } else { dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n"; } } } else { //strings/chars/numbers etc. dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; } return dumped_text; } </script>
try use load older jquery library dynamic if use firefox, , load newest jquery library if using chrome.
var isopera = !!window.opera || navigator.useragent.indexof(' opr/') >= 0; // opera 8.0+ (ua detection detect blink/v8-powered opera) var isfirefox = typeof installtrigger !== 'undefined'; // firefox 1.0+ var issafari = object.prototype.tostring.call(window.htmlelement).indexof('constructor') > 0; // @ least safari 3+: "[object htmlelementconstructor]" var ischrome = !!window.chrome && !isopera; // chrome 1+ var isie = /*@cc_on!@*/false || !!document.documentmode; // @ least ie6
Comments
Post a Comment