| | |
JPEG as a Container
Please support our Graphics and Multimedia advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
I was told by one of my friends in a high place that you can make a JPEG into a Container to carry what every you need..... My idea is to put a Java Script in the Container that makes the picture uncopyable to print page and right click..... Also would like to put a note pad into the Image for copywrites information. The Question is........ HOW DO YOU MAKE A JPEG IMAGE A CONTAINER......
Steven Petersen
Web Designer / Web Master
Web Designer / Web Master
Try this approach:
(this example using jquery)
javascript Syntax (Toggle Plain Text)
$(function(){ $('img').each(function(){ $(this).bind("rightclick mouseover mouseout drag",function(){return false;}); $('body').append('<div class="trans"> </div>').css({'width':$(this).width()+'px', 'height':$(this).height()+'px', 'position':'absolute', 'top':$(this).offset().top+'px', 'left':$(this).offset().left+'px', 'background':'transparent'}); }); });
Last edited by codejoust; Sep 1st, 2009 at 2:18 pm.
CodeJoust! Design + Development - Proud User of Ubuntu
I'd you can give me a link (Or pm) I might be able to help.
To answer your question, you add it in a <script type="text/javascript">[my code]</script>
<script type="text/javascript" src="[scr of jquery]"></script>
To answer your question, you add it in a <script type="text/javascript">[my code]</script>
<script type="text/javascript" src="[scr of jquery]"></script>
CodeJoust! Design + Development - Proud User of Ubuntu
Correction =
and probably in the header.
html Syntax (Toggle Plain Text)
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="path/to/my.js"></script>
Last edited by codejoust; Sep 1st, 2009 at 8:07 pm.
CodeJoust! Design + Development - Proud User of Ubuntu
Did you add the code?
My JS file is (sorry, I made a mistake).
Take that code and put it in a .js file, using the html I provided above in the header to use it (the 2 script tags).
My JS file is (sorry, I made a mistake).
javascript Syntax (Toggle Plain Text)
$(function(){ $('img').each(function(){ $('<div class="trans"> </div>').appendTo('body').css({ 'width':($(this).width() + 20)+'px', 'height':($(this).height() + 20)+'px', 'position':'absolute', 'top':$(this).offset().top+'px', 'left':$(this).offset().left+'px', 'background':'transparent'});}); $('img, .trans').bind("rightclick mousedown contextmenu mouseover mouseout drag",function(){return false;}); });
CodeJoust! Design + Development - Proud User of Ubuntu
css Syntax (Toggle Plain Text)
@media print { img { background:url('./images/copyright.jpg'); } }
html Syntax (Toggle Plain Text)
<img style="background:url('./images/realpic.jpg')" src='./images/blank.gif' width='width of realpic' height='height of realpic'> <img style="background:url('./images/anotherpic.jpg')" src='./images/blank.gif' width='width of anotherpic' height='height of anotherpic'>
all images have the same src, the background is the real image
the print styling is generic, can be refined to take a class or id of image to copyright, and allow non-copyright images to print
Last edited by almostbob; Sep 2nd, 2009 at 9:54 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
•
•
Did you add the code?
My JS file is (sorry, I made a mistake).
javascript Syntax (Toggle Plain Text)
$(function(){ $('img').each(function(){ $('<div class="trans"> </div>').appendTo('body').css({ 'width':($(this).width() + 20)+'px', 'height':($(this).height() + 20)+'px', 'position':'absolute', 'top':$(this).offset().top+'px', 'left':$(this).offset().left+'px', 'background':'transparent'});}); $('img, .trans').bind("rightclick mousedown contextmenu mouseover mouseout drag",function(){return false;}); });
im going to try this other one here as well thank you....
Steven Petersen
Web Designer / Web Master
Web Designer / Web Master
•
•
•
•
css Syntax (Toggle Plain Text)
@media print { img { background:url('./images/copyright.jpg'); } }blank.gif is a 1px transparent .gif imagehtml Syntax (Toggle Plain Text)
<img style="background:url('./images/realpic.jpg')" src='./images/blank.gif' width='width of realpic' height='height of realpic'> <img style="background:url('./images/anotherpic.jpg')" src='./images/blank.gif' width='width of anotherpic' height='height of anotherpic'>
all images have the same src, the background is the real image
the print styling is generic, can be refined to take a class or id of image to copyright, and allow non-copyright images to print
What about the Print Screen
Last edited by stevenpetersen; Sep 3rd, 2009 at 4:41 pm.
Steven Petersen
Web Designer / Web Master
Web Designer / Web Master
![]() |
Similar Threads
- is it possible to save a visual basic form in jpeg format??? pls help... urgently... (Visual Basic 4 / 5 / 6)
- Using the STL LIst Container, how do I create, write,read, and store in file. (C++)
- I Can't Resize A JPEG. (Windows NT / 2000 / XP)
- Inserting a jpeg image into a MSWord document. Max OS X. (Mac Software)
- Drawing A Table On A Container(Panel) (Java)
- default save/bmp vs jpeg (Web Browsers)
- Error Message in the VM (Windows NT / 2000 / XP)
- Can't display JPEG, GIF in IE6 (Web Browsers)
- IE "Save Image as;" Bitmap, wont in JPEG??? (Web Browsers)
Other Threads in the Graphics and Multimedia Forum
- Previous Thread: New bee hereā¦!
- Next Thread: Interactive UK map in flash, with counties or postcode area
| Thread Tools | Search this Thread |
3d 10 actionscript3 adobe adobeacrobat adobereader air ajax amazon amf apple button cart childprotection cloud dashboard dell design dojofoundation dreamweaver ebay eclipse ecommerce elasticcomputecloud embed endorsement extra family flash flash-develop flashlite flex free harddrive iamthwee ibm illustrator imflash intel interactivemap javafx javascript laptop legal map micron microsoft mobile monitoringsoftware moonlight multimedia myspace nand news novell panorama pdf pedophiles photoshop photosynth php safety sandisk security shopping silverlight solidstatedrive sproutcore ssd streaming swf table ukmap unload unwanted video vulnerability web white.space xml zend zephyr zeroday






