when you call colorpicker function, add options hash as a second
parameter {IMAGE_BASE: 'img/'}. Change the path to one where your
images are, but if you store them in your app's image folder it should
most likely be "/img/".
Note the leading and trailing slashes, leading one tells the script to
start looking in your site's root directory. You don't have to use it
but the script will then look for images in the path relative to the
current url. The trailing slash is required by the script.On Oct 5, 6:45 pm, emmexx <[email protected]> wrote: > I'm trying to use colorpickerjs in cakephp but I have some trouble > with the image files used by this tool. > > http://code.google.com/p/colorpickerjs/ > > The javascript file of the tool references all images with the > following code: > > this.options = Object.extend({ > IMAGE_BASE : "img/" > }, options || {}); > > and then: > element.innerHTML='<div id="colorpicker-selector"><img src="' + > this.options.IMAGE_BASE + 'select.gif" width="11" height="11" alt="" / > > ></div>'; > > That code translates in the following html inside my cake application: > > <div id="colorpicker-hue-thumb" class="selected" style="top: 92px;"> > <img src="img/hline.png"/> > </div> > > (just look at the img tag) > > And of course the image cannot be found... > > Is there a cakephp way to solve this? I mean, I can't use a > htmlHelper, I suppose I should modify the IMAGE_BASE path or put the > colorpickerjs files elsewhere (now they are inside webroot/js/ > colororpickerjs). > I'd prefer non to modify the javascript code. > > Thank you > maxx --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
