Treehouse: Grow your CSS skills. Land your dream job.

Add/Remove Class, not working on iPhone

  • # March 14, 2012 at 1:43 pm


    I’m working on a minimal design for myself, I’ve tested in in Chrome, Opera, Firefox and Safari
    and I think it degrades nicely in IE8
    When you click on a date in the timeline it adds a class “open” to the element which adds 60px to the height
    But for some reason, on mobile safari this doesn’t work

    I’ve tried using .attr(‘class’,’open’); and .addClass(‘open’); which both work fine in normal browsers

    Anybody come accross this before?

    Here’s the work in progress (far from complete)

    # March 14, 2012 at 2:21 pm

    Must be something with that nano function in your .js file. If you remove everything before the var ua = navigator.userAgent line, it does work on iPhone.

    # March 14, 2012 at 3:06 pm

    Thanks Senff
    It looks like there’s conflicting bind events
    I’ll have to integrate my script into this nano scroller plugin

    # March 14, 2012 at 10:24 pm

    Added a condition to not allow this script to run on iOs devices :)

    # March 14, 2012 at 10:46 pm

    What’s the reasoning behind such a small scroll area Karl?

    # March 14, 2012 at 10:56 pm

    Just to be different :)
    most people take full sized sites and make them smaller for mobile devices
    I wanted to try make something that would be the same on all of them

    # March 14, 2012 at 11:20 pm

    Fair enough, my only concern is that it’s a bit of a nightmare usability wise :(

    I’d rather have a single page that scrolled instead of multiple scrolling elements.

    # March 14, 2012 at 11:24 pm

    I might actually take out that timeline thing
    It’s mostly BS and doesn’t look right ha

    # March 14, 2012 at 11:38 pm

    I think it’s pretty interesting, but maybe you could come up with a more original way to show it?

    # March 15, 2012 at 12:03 am

    I was also thinking of a horizontal slider that you drag with the mouse or swipe on touch devices
    I can never settle on a design for myself :S

    # March 15, 2012 at 12:10 am

    Haha, I know the feeling!

    # March 15, 2012 at 12:13 am

    part of me wants to design an extravagant fancy site and try to win an awwward for it, then part of me wants to keep it simple

    I should design a bipolar site, so I can change it at the press of a button based on my mood

    # March 15, 2012 at 12:22 am

    It’s certainly harder designing with a set of restrictions in place. I took that approach for my weblog; I wanted readability the focus, and that imposed a set of rules I needed to work within. I really enjoyed the process though, although I am always tempted to make changes to it.

    My advice would be to design for you, rather than for some award that you may or may not win.

    # March 15, 2012 at 12:33 am

    Ha I didn’t mean literally design just for an awwward, but it would be nice
    Why are we more difficult than clients ha

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.