I want a message to pop up when clicking on a picture in WP

7 replies
  • |
Hey Gang

I have a squeeze page which has a screen shot of a video, and below that is the opt in (this is in Wordpress). I would like it so if the visitor clicks on the video, a message pops up saying "please sign up below to watch the video". I've got a tool tip doing something similar, but not really as good as a pop up.

Any ideas?

Many thanks
#clicking #message #picture #pop
  • Profile picture of the author Istvan Horvath
    On any normal HTML page this Javascript should work:

    <a href='javascript:onClick=alert("Put in your email address")'>
    <img src="image.jpg" />
    Of course, change your message - alert("...")
    and replace image.jpg with the path and image file name of yours.

    Warning: WordPress is usually unhappy if you put JS in posts/Pages!

    {{ DiscussionBoard.errors[6314287].message }}
    • Profile picture of the author rhinocl
      See post immediately above.
      So given that WordPress gets unhappy with Javascript how do you get around that? Use a static page in the middle of your WordPress site?
      Find some plugin that cancels out WordPress security concerns?? with JavaScript? Use the JavaScript elsewhere and bring it in as an i-frame? There has to be a better way than these?
      {{ DiscussionBoard.errors[6316666].message }}
  • Profile picture of the author Istvan Horvath
    How about reading the documentation? (see the questions immediately above )
    Using Javascript « WordPress Codex

    {{ DiscussionBoard.errors[6317222].message }}
  • Profile picture of the author phil.wheatley
    Hi Guys

    Thanks for your replies, wow, seems a bit more complex than I realised. I'll try the above.

    Thanks again

    It's still not working for you??? Need direction?...
    ---->>>> BrainDirection.com <<<<----
    {{ DiscussionBoard.errors[6319494].message }}
  • Profile picture of the author failideas
    you can do that with jquery
    add this code at the bottom before the </body> tag

    $(document).ready(function() {
    $(".imgalert").click(function() {
    alert("My message to you!");

    add an class to your image called imgalert

    another option would be, when image clicked present them with the form to be filled in a modal window saying they need to fill the form to see the video.
    Dental WordPress Theme - Dentist WP Theme - Lawyer WordPress Theme

    ++ Theme Release News and Promotions > submit here
    Affiliates - wanna make good money. Subscribe here Affiliates List
    {{ DiscussionBoard.errors[6322594].message }}
  • Profile picture of the author Paul Dunstan
    Top information here. I wanted to do this!

    UK Psychology Teacher Strikes Back For The Newbies!
    {{ DiscussionBoard.errors[7236302].message }}
  • Profile picture of the author SmallBizWebsites
    People tend not to like unexpected pop-ups, and they could be blocked by the browser itself or add-on blockers. Your pop-up is unexpected because if someone clicks on a video, they expect it to play.

    Instead of your present approach, have you considered using an image which has text on it "Click Here to register and play the video", or something similar?
    {{ DiscussionBoard.errors[8036282].message }}

Trending Topics