Note that there are some explanatory texts on larger screens.

plurals
  1. POcolor picker method not found in jquery
    primarykey
    data
    text
    <p>i have a jquery project that adds divs...i want ta make those divs as color pickers...so i wanted to use websanova-wColorPicker jquery library..but after integrating it with my code. i get an error in chrome that the color picker method wasnt found..</p> <p>once i remove my jquery code that adds the div..the color picker works..thus i have come to a conclusion that its because of a conflict as i have tried another color picker library as well with the same error...i use jquery ui as well</p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'wColorPicker' i.html:83 jQuery.click.show i.html:83 f.event.dispatch jquery.1.7.1.min.js:3 f.event.add.h.handle.i jquery.1.7.1.min.js:3 </code></pre> <p>so here is my problem..how do i create dynamic divs with the Websanova Color Picker applied ie. each div is a color picker..help.</p> <p>code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Websanova Color Picker&lt;/title&gt; &lt;link href="css/index.css" rel="stylesheet" type="text/css"&gt; &lt;script type="text/javascript" src="./inc/jquery.1.7.1.min.js"&gt;&lt;/script&gt; &lt;link rel="Stylesheet" type="text/css" href="./wColorPicker.css" /&gt; &lt;script type="text/javascript" src="./wColorPicker.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="wColorPicker7" class="hoverBox"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $("#wColorPicker7").wColorPicker({onSelect:function(color){/*do something*/}, mode: 'click', effect: 'fade', color: 'yellow'}); $(window).load(function(){ jQuery("#coldwn").click(function(event){ var showOptions = function() { $(this).css("background-image", "url(images/us.png)"); }; var showOptionso = function() { $(this).css("background-image", "url(images/ua.png)"); }; var cc = function() { var letters = '0123456789ABCDEF'.split(''); var c = '#'; for (var i = 0; i &lt; 6; i++ ) { c += letters[Math.round(Math.random() * 15)]; } $(this).css("background-color", c ); }; w=document.getElementById('coldwn').offsetWidth; var x = event.pageX; var p=(x-403)*100/w; var per=p.toFixed(0); xa = document.getElementById('coldwn').offsetTop; var x = event.pageX, y = event.pageY; var $mystub=jQuery("&lt;div&gt;").addClass("node").attr('id', x+'o').css({position: "absolute",left:x,top:xa,width:"16px",height:"20px"}).hover(showOptions,showOptionso); var $mystuba=jQuery("&lt;div&gt;").addClass("color").attr('id', x+'i').css({position: "absolute",top:"7px",width:"16px",height : "14px",value:p,autocomplete:"off"}).click(cc); $mystub.append($mystuba); $('#coldwn').append($mystub); $("#"+x+"i").wColorPicker({onSelect:function(color){/*do something*/}, mode: 'click', effect: 'fade', color: 'yellow'}); $("#"+x+"o").draggable({ containment: "#coldwn", scroll: false,axis: "x", start: function() { }, drag: function(event, ui) { var x = event.pageX; var p=(x-403)*100/w; var per=p.toFixed(0); $('textarea').val(per); // -webkit-linear-gradient(bottom, rgb(40,51,157) 32%, rgb(68,77,189) 66%, rgb(105,138,14) 77%); }, stop: function() { var x = event.pageX; var p=(x-403)*100/w; var per=p.toFixed(0); alert(per); } }); }); }); function d() { var i=20; var str=""; alert($('#coldwn').children("div").size()); $('.node').children("div").each(function() { var kid = $(this); var cr = $(this).css("background-color"); str+=cr+" "+i+"%,"; console.log(str); i+=20; console.log(kid.attr('id'),cr); }).sort(); str+="rgb(105,138,14) 100%)"; alert(str); $('#mainarea').css("background-image","-webkit-linear-gradient(bottom, "+str ); console.log("background-image","-webkit-linear-gradient(bottom, "+str); // $('#mainarea').css("background-image","-webkit-linear-gradient(bottom, rgb(40,51,157) 32%, rgb(68,77,189) 66%, rgb(105,138,14) 77%)" ); } &lt;/script&gt; &lt;p&gt; &lt;span id="u70"&gt;CSS GRADIENTS&lt;/span&gt; &lt;/p&gt; &lt;p&gt; &amp;nbsp; &lt;/p&gt; &lt;div id="wrap"&gt; &lt;div id="topop" class="topop"&gt;&lt;/div&gt; &lt;div id="mainarea" class="maingrad"&gt;&lt;/div&gt; &lt;div id="coldwn" class="col"&gt;&lt;/div&gt; &lt;/div&gt;&lt;br&gt; &lt;div id="wColorPicker7" class="hoverBox"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>note:the code in jquery creates divs..i want then to be colorpickers</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload