need quick help - javascript
2013-11-25, 02:00 AM,
#1
hey,

i am no coder so i don't know the basics..

but how can i make a image hidden on page load ?

i use a js code to make the image visible by onclick button,

but the image is already visible when i visit the site :(

here is the code i use..

textuploader.com/d8a5
Reply
2013-11-25, 02:34 AM,
#2
Does it have to be activated by onclick? If you were happy with a hover, it could be done very easily in CSS. Javascript isn't the easiest for inexperienced coders.

[Image: 5pYQo.png]
Reply
2013-11-25, 02:37 AM,
(This post was last modified: 2013-11-25, 02:37 AM by qannabōs.)
#3
(2013-11-25, 02:34 AM)Kappa Wrote: Does it have to be activated by onclick? If you were happy with a hover, it could be done very easily in CSS. Javascript isn't the easiest for inexperienced coders.
Give it a try to this and change:
Code:
<center><IMG id="myimg" src="button.png" border="0"></center>
to
Code:
<center><IMG id="myimg" src="button.png" border="0" style="display:hidden;"></center>
Reply
2013-11-25, 02:38 AM,
(This post was last modified: 2013-11-25, 02:43 AM by FreePls.)
#4
yea it has to be onclick

is there no string i could use for the css or index to keep the image hidden on pageload?

(2013-11-25, 02:37 AM)qannabōs Wrote: Give it a try to this and change:
Code:
<center><IMG id="myimg" src="button.png" border="0"></center>
to
Code:
<center><IMG id="myimg" src="button.png" border="0" style="display:hidden;"></center>

still visible on pageload Cry
Reply
2013-11-25, 03:38 AM,
#5
(2013-11-25, 03:13 AM)Banned for spamming, please report this. Wrote: Take a look of this --> jsfiddle.net/rVBzt/51/

oh god thats to much new stuff for me, i can't modifier that for my script im newbie (also take care that the trigger image triggers something else too.. ), so i have NO idea how to modify that to get it work on my script :D

isn't there some easier solution like a "page onload img id myimg hidden" line ? Grin
Reply
2013-11-25, 05:19 AM,
#6
(2013-11-25, 03:38 AM)FreePls Wrote:
(2013-11-25, 03:13 AM)Banned for spamming, please report this. Wrote: Take a look of this --> jsfiddle.net/rVBzt/51/

oh god thats to much new stuff for me, i can't modifier that for my script im newbie (also take care that the trigger image triggers something else too.. ), so i have NO idea how to modify that to get it work on my script :D

isn't there some easier solution like a "page onload img id myimg hidden" line ? Grin

This is actually exceptionally simple and exactly what you've asked for. Replace the 'Show image' text in the toggle div with your button:

Code:
<img src="button.png"/>

Modify the CSS and nest the image as such so that not all of the images on the pages are hidden:

Code:
.toggle img{

[Image: 5pYQo.png]
Reply
2013-11-27, 05:54 AM,
(This post was last modified: 2013-11-27, 06:30 AM by FreePls.)
#7
yea nice solved it myself with some other code..


Code:
<center><a href="#" onClick="javascript:getIt();"><img src="triggerButton.jpg" border="0" onclick="document.getElementById('test').style.visibility = 'visible'; return false;"></a></center>

<center><img style="visibility: hidden;" src="image.png" id="test" border="0"></center>

Grin

works great, image is hidden on page load and after trigger one time it stays even if i trigger again, thats all i need :)

your codes might work too but i am to stupid to use them Embarrassed

is there a working code for blocking visitors viewing source code with ctrl+u ?

tried some button blocking js codes but did not worked, even if i block with keycode 17 for ctrl or 85 for U i still can see the source :(
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [SHARE} High Quality Javascript ALERTS! Mimo 0 1,015 2016-07-11, 05:13 PM
Last Post: Mimo
  Anyone good with Javascript? hawdaze 6 813 2015-11-09, 11:43 PM
Last Post: serpkiller
  13 Quick Tips to Improve Your Web HawkEye 5 1,091 2015-04-18, 01:49 PM
Last Post: HawkEye
  Change file size in files array with JavaScript Heka 1 389 2015-04-08, 12:14 AM
Last Post: SpawnOfdarkness
  cpa and javascript idoyonatan 1 375 2015-03-05, 07:44 PM
Last Post: neverstop




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top