+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 41




need the text to go away when clicked

This is a discussion on need the text to go away when clicked within the Graphic Design and Web Design Help, part of the General category; This is a really simple inline function. To place this anywhere else, especially in a separate file all on it's own, would be require ten times more code and increase the server request load. ...

  1. #11
    Design Guru Arkady's Avatar
    Join Date
    Apr 2007
    Location
    Glasgow
    Posts
    2,684
    This is a really simple inline function. To place this anywhere else, especially in a separate file all on it's own, would be require ten times more code and increase the server request load. Not by a significant amount it's true but nevertheless; I can't think of any good argument for not using simple inline functions like this when it makes sense to do so.




  2. #12
    Mr. Tambourine Man LeadMagnet's Avatar
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    2,814
    What's the better way to do it then if that's deprecated?
    Subtlety is my middle name... and first and last in case you didn't get the point.
    http://www.eoingriffin.com




  3. #13
    CSS Wizardry Harry's Avatar
    Join Date
    May 2007
    Location
    Leeds, England
    Posts
    13,655
    Haha Eoin you know I know nothing about JS but I read it's best to let JS do all the work and leave markup untouched. I'm saying now I could be wrong but that means that the source I got it from is also wrong.




  4. #14




  5. #15
    CSS Wizardry Harry's Avatar
    Join Date
    May 2007
    Location
    Leeds, England
    Posts
    13,655
    ^ That's the one!




  6. #16
    Mr. Tambourine Man LeadMagnet's Avatar
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    2,814
    JS libraries. Bah! Hogwash!
    Subtlety is my middle name... and first and last in case you didn't get the point.
    http://www.eoingriffin.com




  7. #17
    norks! ...Gav's Avatar
    Join Date
    Oct 2007
    Posts
    461
    I just needed a very simple solution for a website that will be live for about 3 weeks.

    Arkady you have hit the nail on the head mate, thank you very much :D
    Soon to be here:
    holeycoww designs




  8. #18
    Design Guru Arkady's Avatar
    Join Date
    Apr 2007
    Location
    Glasgow
    Posts
    2,684
    Quote Originally Posted by ...Gav View Post
    I just needed a very simple solution for a website that will be live for about 3 weeks.

    Arkady you have hit the nail on the head mate, thank you very much :D
    My Pleasure.




  9. #19
    likes chips. Scriptage's Avatar
    Join Date
    May 2008
    Location
    Yorkshire
    Posts
    2,760
    The only realistic way of doing this is the way that Arkady has demonstrated. Microsoft has not implemented the W3C's event handling model, i.e., addEventListener(event, function, state); instead they implemented their own attachEvent which is pretty useless for doing anything with data from the object it is attached to.

    You could of course do:

    Code:
     
    document.getElementById("foo").onclick = function(){
    
    if(this.value == "Your name here") this.value = ""; 
    
    };
    but this needs to be placed after the element it is attached to in the code. This can be remedied by attaching the event after the page is loaded:

    Code:
     
    onload = function(){
    
       document.getElementById("foo").onclick = function(){
    
       if(this.value == "Your name here") this.value = ""; 
    
       };
     
    };
    This can get messy if you need to do numerous things at page load so you're probably going to want to create an event stacking function. It may look prettier in the markup but the Javascript is going to be awful.

    I'm not sure it's worth it.




  10. #20
    Design Guru Arkady's Avatar
    Join Date
    Apr 2007
    Location
    Glasgow
    Posts
    2,684
    ^^^ My point almost exactly. Why replace a simple in-line statement with a mass of tangled code behind statements just because the trendies want total separation in all circumstances. It strikes me that there is a certain amount of coding fascism when it comes to these kinds of subjects. You do what works best, is the most readable and is the most economical in terms of available resources.




+ Reply to Thread
Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast





Similar Threads

  1. Text
    By KyleOpium in forum Graphic Design & Web Design Critique
    Replies: 5
    Last Post: 09-02-2009, 10:17 AM
  2. inserting text in indesign (creating text art)
    By a3dy in forum Design and Print Software
    Replies: 1
    Last Post: 10-03-2008, 01:47 PM
  3. Text 2 PNG
    By katie roos in forum General Web Design Forum
    Replies: 0
    Last Post: 28-01-2008, 03:05 PM
  4. Text Pic
    By Toon in forum Off Topic
    Replies: 4
    Last Post: 24-01-2008, 07:12 AM
  5. 3D Text
    By Dinx in forum Graphic Design and Web Design Help
    Replies: 6
    Last Post: 07-12-2007, 11:42 PM

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


Free Decent Downloads Free Quality Wallpapers Graphics Forum Free Vista Themes
The Top The Best Images Logo Design - $149 Affordable Stock Vector Illustrations Creativecurio - Design Blog Graphic Design Advertising

Check the forum often for the latest design announcements. Everything from graphic design and web design, to films and music.
Estetica is a great place for people to get together and help each other out.


Web Hosting - UK Web Hosting services for business or personal website hosting needs.


Dedicated Servers - A full range of Managed Dedicated Server solutions suitable for all your requirements.


Online Backup – Backup Technology offers competitive online backup, disaster recovery and business continuity.


Web Design UK | Vision.To Design | Leaflet Printing | Estetica Design Forum's Privacy Policy | Pocono Web | Flyer Printing | Photography Blog | Graphic Design Links


Graphic Design Social Network | Logo Design | Brochure Printing | Land for sale | Leaflet Printing | CNC Precision Engineering | Graphic Design Blog


Custom Logo Design - $149 Only | Affordable Print Design Templates | Small Business Logo Design | Company Logo Design


Logo Design Service | Logo Design Firm | Logo Design Reseller | Custom Logo Design | Letterhead Printing | Flyer Printing | Business Card Printing


Online Backup | T-Shirt Printing | Personalised Mugs | Canvas Printing | Tradeshow Ideas