SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Running JQuery on a mobile phone

    I.ve created a twitter bootstrap based website that scales perfectly to mobile and tablet. I want to use jquery on the website to handle the navigation so that when the site is viewed on a mobile device the user clicks the category button and the sub categories drop down. This saves a huge list showing on the smaller screen. I've got it working fine on the desktop version of the site but when I test on my iPhone 5 phone, no jquery navigation just a long list of sub categories.

    Do I have to enable JQuery Mobile to use JQuery on a mobile site or should it work straight out of the box so to speak?

  2. #2
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should this just work with no additional code? Or is there anything that I have to setup for the mobile versions of the website? Would really appreciate an answer on this.

  3. #3
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You certainly need to reference the Jquery js file in the <head> of your document containing the nav.
    Steve Husting

  4. #4
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My navigation is contained within an include file. I have a reference jquery in the footer. I was under the impression that the correct place to call javascript was at the end of the document or am I wrong? Incidentally I'm referencing to jquery using

    Code:
    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

  5. #5
    SitePoint Wizard
    Join Date
    Feb 2007
    Location
    Southern California
    Posts
    1,388
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    That seems to be fine. I would suggest looking at the CSS that is tied to the jquery and make sure that is referenced as well.
    Steve Husting

  6. #6
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, will check it out


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •