SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Tabbed dlg widget using only html/xhtml/css?

    Hello,

    Since from a security perspective javascript is a no-no, I always have client machines disable js; also, php et al has too many security issues.

    That being said, I would like pointers/tips to a tabbed dialog widget using only html, xhtml, and css.

    Here is an example of what I am aiming for minus the flaw of using js :

    http://jon.hedley.net/html-tabbed-dialog-widget

  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)
    You can't have both HTML and XHTML, it's either one or the other. This sort of thing has been explored extensively at http://www.cssplay.co.uk, have a look at his tabbed photo galleries. The (big) disadvantage is that if the user clicks outside the tab, it disappears back to the default one. This is where javascript is useful because CSS doesn't provide a "clicked" pseudo-class, only "active" and "focus", which are not the same and not wholly supported across all the main browsers.

    A better idea is to make all three tabs (or however many you have) one after the other, so that with JS off the user can still use all of them. Then with javascript you create the tabs and make your "widget". This is what is called progressive enhancement. In the other direction, you could then say that your page will "degrade gracefully" when JS is off.

    Javascript isn't a flaw. And in this instance there is no security issue really, all you're doing is adding/removing class names from HTML elements.

  3. #3
    SitePoint Member
    Join Date
    Oct 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thanks Stu's code is roughly what I was in need of

    Quote Originally Posted by Raffles View Post
    You can't have both HTML and XHTML, it's either one or the other. This sort of thing has been explored extensively at http://www.cssplay.co.uk, have a look at his tabbed photo galleries. The (big) disadvantage is that if the user clicks outside the tab, it disappears back to the default one. This is where javascript is useful because CSS doesn't provide a "clicked" pseudo-class, only "active" and "focus", which are not the same and not wholly supported across all the main browsers.

    A better idea is to make all three tabs (or however many you have) one after the other, so that with JS off the user can still use all of them. Then with javascript you create the tabs and make your "widget". This is what is called progressive enhancement. In the other direction, you could then say that your page will "degrade gracefully" when JS is off.

    Javascript isn't a flaw. And in this instance there is no security issue really, all you're doing is adding/removing class names from HTML elements.
    Thanks for being a bit condescending to start off *chuckle* It's all good though. For my own personal sites I don't mind using scripting(though KISS is preferred over never-ending-load-times of web 2.0 sites lol); for some corporate sites it isnt a solution. So, I do appreciate your comment on the js design degrading gracefully - I'll probably go that route on my own site.

    Thanks for the help,
    x


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
  •