var isMobile = jQuery.browser.mobile;需要别的

时间:2012-09-26 19:34:23

标签: javascript jquery-plugins

我有一些效果很好的东西。 var isMobile正在停止工作的其余部分,当它被部署为包含时,但在它自己的页面上完美地工作。

我希望阻止执行的jQuery插件名为Meerkat,它显示并隐藏了一个浏览器底部拥抱div。只要Meerkat没有出现在手机或平板电脑上,一切都是copacetic。非常糟糕的用户体验。我认为我有一个使用detectmobilebrowser.js的赢家

$(document).ready(function(){
  var isMobile = jQuery.browser.mobile;
  if(isMobile)
  {
    window.location.href = 'http://*******/nomeerkat.html';
  }
});

这是一个独立的功能,meerkat功能适用于非移动/平板电脑平台。当作为include桌面平台预订时,没有执行meerkat功能。没有数量的谷歌搜索已经发现任何与检测移动相关的if else的例子。 :(

$(function(){
  $('.meerkat').meerkat({                      
    background:'url(\'http://****.jpg\') repeat-x left top',
    height: '90px',
    width: '940px',
    position: 'bottom',
    close: '.close-meerkat',
    dontShowAgain: '.dont-show',
    animationIn: 'fade',
    animationSpeed: 1000,
    removeCookie: '.reset'
  }).addClass('pos-bot');
  $('#bottom').click(function(){
   $('.meerkat').destroyMeerkat();
   $('.meerkat').meerkat({
     height: '90px',
     width: '940px',
     position: 'bottom',
     close: '.close-meerkat',
     dontShowAgain: '.dont-show',
     animationIn: 'slide',        
     animationSpeed: 1000,
     removeCookie: '.reset'
   }).removeClass('pos-bot');
   $('.code').hide();
   $('.bottom_').show();
   return false;
 });
});

0 个答案:

没有答案