SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pick colors from within iframe

    Is it possible to pick colors from an iframe using some kind of eyedropper in JavaScript or jQuery? Both the page (that contains iframe) and iframe are on the same domain. Thanks for any ideas.

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,883
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    Sure it's possible.
    I've thrown together a little example here: http://hibbard.eu/blog/pages/iframe-color-picker/

    I've used sstrudeau's jquery-dropper plugin to implement the eye-dropper.
    I've then taken his basic demo, stuck the images etc within an iframe and tweaked the code a little.

    If you have a look at the page source, you should be able to see what's going on.
    If you have any questions, just let me know.
    If it helps, I can also send you the files.

  3. #3
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Hi,

    Sure it's possible.
    I've thrown together a little example here: http://hibbard.eu/blog/pages/iframe-color-picker/

    I've used sstrudeau's jquery-dropper plugin to implement the eye-dropper.
    I've then taken his basic demo, stuck the images etc within an iframe and tweaked the code a little.

    If you have a look at the page source, you should be able to see what's going on.
    If you have any questions, just let me know.
    If it helps, I can also send you the files.
    It looks nice but in my application the color picker is outside of the iframe. Besides, my iframe does not consist only of images, it is a web page preview.

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,883
    Mentioned
    208 Post(s)
    Tagged
    12 Thread(s)
    Glad you like it
    It was just a demo to answer your original question of whether this is possible.
    If you can find a colour-picker (eye-dropper??) that allows you to pick colours from anywhere on the page, I can help you implement it in an iframe.

  5. #5
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pullo View Post
    Glad you like it
    It was just a demo to answer your original question of whether this is possible.
    If you can find a colour-picker (eye-dropper??) that allows you to pick colours from anywhere on the page, I can help you implement it in an iframe.
    Well, I have been looking for that (a colour-picker that allows you to pick colors from anywhere on the page) but I couldn't find one. Maybe it is not possible and that's why there are no scripts to do that.


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
  •