SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remove div for mac users

    I am new to javascript and I was wondering what is the best way to solve my problem below:

    I have 2 navigation menus one using flash and one using images. I wanted to use javascript to detect if the viewer is using a mac and then remove the div that contains the flash and if they are not using a mac then remove the div that contains the images.

    If there is a better way to resolve this problem I am all ears.

    Thanks in advance.

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    In an effort to resolve the issue, it would be useful to know why you don't want the Mac users to view the Flash. Is it anti-Mac propaganda?

  3. #3
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The flash based menu does not work on my friends ipad and I read that mac does not support flash so I need a non-flash menu for mac users.

  4. #4
    I Love Licorice silver trophybronze trophy Datura's Avatar
    Join Date
    Aug 2006
    Location
    Florida USA
    Posts
    5,775
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    MAC computers do support flash, the ipad does not.
    Ulrike
    TUTs: 1 2 3 4 5 6 7 8 9 10

  5. #5
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The solution is to provide the images first. Then, if the computer supports Flash, you can add the Flash content. This means you're not just blindly targetting one type of users, but providing exactly the content people can support.

    The easiest way to do this is to use SWFObject (google it), as it does the detection and creation of the Flash objects all for you.

    By the way, Flash menus are generally pretty horrible and it is not what Flash should really be used for. If you want sliding animations and fading effects, you don't need Flash for that. JavaScript is perfectly capable of those things, especially if you use something like jQuery UI (again, google it).

  6. #6
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I see what you are saying I just started to mess with Javascript and Jquery so I plan on using them instead of flash in the future. Unfortunately all of the images and flash that makes up the menu is coming from a .swf and .as file so I was hoping to just use a separate menu for when flash is not supported.

    Below is the script I am using to remove the div, but it is removing the div on the iphone as well.

    <script type="text/javascript">
    function removeElement(){
    var element = document.getElementById();
    element.parentNode.removeChild(element);
    }
    if(navigator.userAgent.indexOf("Windows") != -1){
    removeElement(navigation);

    }
    </script>

    But now it looks like I just need to remove the non flash div for users with an ipad.

    This is my first website and its for a small local company and I would probably not worry about ipad users for now since it is very unlikely one would use the site, but the owner has one.

    Here is the test site in case you were curious to see how deep I am into the project and why I am looking for a quick fix.

  7. #7
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Datura I was under the impression it was mac in general, so that is good to know.


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
  •