Web Analytics Made Easy -
StatCounter print button for an image - CodingForum

Announcement

Collapse
No announcement yet.

print button for an image

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • print button for an image

    How do I create a Print button, and makes it print an image on that page only, ignoring everything else? is that possible? thanks!

  • #2
    You would have to set up a media="print" stylesheet for the page that tells it to only print that part. You would also need to switch stylesheets before printing so as to select the stylesheet with the appropriate part of the page to be printed.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

    Comment


    • #3
      couldn't you also do something like:
      Code:
      <img src="[...]" id="image" /> 
      
      <a href="javascript:image.print">Click here to print image</a>
      Dan
      PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

      Don't forget to save everyone time and mark your thread as Resolved :)

      "Also note that it is your responsibility to die() if necessary."

      DON'T USE THE MYSQL_ EXTENSION

      Comment

      Working...
      X