Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Mobile jQuery and Personal site

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #33568

    So I’m using the plugin built by will which creates the page flip. The draggable feature is great however, I’m wanting to also create a mobile/iPad version. Basically at this point I have linked to jQuery mobile so I can use the swipe feature, instead of will’s draggable feature. However, i’m not getting my desired results. What I’m doing is seeing if the user is on an iPhone using this code and then if it is process the event.


    function isiPhone(){
    return (
    (navigator.platform.indexOf("iPhone") != -1) ||
    (navigator.platform.indexOf("iPod") != -1)
    );
    }

    if(isiPhone()){
    $(p0).bind('swipeleft', function(event, ui) {
    temp = ui.position.left - ui.originalPosition.left;
    p0.removeClass('b-grab').addClass('b-grabbing');
    p0.css({left:40+(temp)/1.5, width:40+(temp)});
    p0wrap.css({right:10+temp/4});
    p1.css({left:ui.position.left+20, width:opts.pWidth-ui.position.left-10});
    p1wrap.css({left:-1*(temp+30)});
    if(opts.shadows){
    if($.support.opacity){
    sB.css({'opacity':0.5*(temp/opts.pWidthH)});
    }else{
    sB.css({'left':-0.38*opts.pWidth});
    }
    }
    });
    }

    I’m new to javascript/jQuery and want to learn, just not sure if I’m off to the right start with this. Is the “right” way to detect if a user is using an iPhone in jQuery? Based on my searching I figured it was, but wanted to get some tips from the experts here :). The entire source file can be found here

    Warning the text,colors, and sizing are just placeholders till I get content and get the swipe feature figured out.

    I appreciate your guidance!!

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.