|
Changing HTML Content on Click & Remove/Reinit qTips
|
|
15th November, 02:18
Post: #1
|
|||
|
|||
|
Changing HTML Content on Click & Remove/Reinit qTips
Hey, gang. Just starting out in web design recently and any help is greatly appreciated. This is for a personal site so please bare with me if things seem out of sorts some. I have a bunch of neat thoughts about getting the tooltip portion of the site done but admittedly I'm a little in over my head at the moment.
Currently I am working with the following code: The HTHL HTML Code
The css CSS Code
The js JAVASCRIPT Code
Here's what I'm trying to do. There are three buttons, each with a tooltip when hovering. Clicking any of the three buttons will change the background color to either red, blue or green. In addition I am trying to accomplish the following- 1.) Upon clicking any of the three color buttons: a. Have the qtip tooltip for that button fadeOut/300ms b. Have the content change so that the div#colorpicker is now 'cloned' into the tooltip. The intention is to leave the original instance of the div#colorpicker in place on page while also pupulating the tooltip with it on click. c. Now Have the tooltip with its changed content fadeIn/300ms. d. Finally, replace/reinitialize the original tooltip content (div#m1, div#m2, div#m3) for any buttons that may have been clicked previously. 2.) Turn all tooltips Off/On by clicking the div#on-off-container. I've gotten it to toggle the two divs within it for appearance (div#tooltips-off, div#tooltips-on) but I still need to get it functioning. If possible I would love to be able to choose between turning on/off only the original tooltips when hovering, thus preserving the tooltips when clicked, or all tooltips (both the original on hover and the replacement when clicked). Either a two button or a toggling single button approach would work I suppose. Live example: http://jsfiddle.net/fkFGn/2/ I've been reading through the posts but have become a little overwhelmed so I thought I should just post this to get things started. Thanks a million. : ) |
|||
|
15th November, 15:06
Post: #2
|
|||
|
|||
|
RE: Changing HTML Content on Click & Remove/Reinit qTips
The color pickeri mplemtnation depends entirely on the plugin you're using for it... can you set that up in the live example please? Here's what I have so far: http://jsfiddle.net/fkFGn/5/
Craig Thompson Web Developer / Designer Craigsworks http://www.craigsworks.com |
|||
|
15th November, 17:38
Post: #3
|
|||
|
|||
|
Implemented the jQuery UI Slider into the example
Hi, Craig. Thank you for the quick response. The toggle button for turning the tooltips off/on is really cool and I appreciate your help.
I have implemented the jQuery UI sliders/colorpicker into the live example: http://jsfiddle.net/ifthatdoesntdoit/fkFGn/6/ I am attempting to get the colorpicker/sliders working as follows: a. Have the colorpicker sliders/handles animate when any of the three color buttons are clicked. b. Have the background color change gracefully at 300ms when either the color buttons or the slider 'bars' are clicked. c. Change/Update the alpha slider gradient to continually show the present color of the colorpicker. Presently the solid portion of the gradient is white and it would be great if this would change with the colorpicker's red, blue and green choices. d. Have qTip tooltips show in the slider handles when either being dragged, when the slider bars are clicked, or when they are animated by any of the three color buttons being clicked. Currently the slider 'bar' colors and the handles are not lining up correctly unless the handles themselves are being dragged. Also, I attempted to implement the qtips into the slider handles as documented in your demo on the qtip2 site, but among other issues I encountered I couldn't get the proper numbers to display at either the beginning or end of the sliders, or when clicking the slider 'bars' instead of dragging the handles. Thank you very much for your help.
|
|||
|
16th November, 20:10
Post: #4
|
|||
|
|||
|
RE: Changing HTML Content on Click & Remove/Reinit qTips
I'm not too sure on why the slider isn't working on anything but click, might be a jQuery bug, but this is pretty close to what you want iirc: http://jsfiddle.net/fkFGn/10/
Craig Thompson Web Developer / Designer Craigsworks http://www.craigsworks.com |
|||
|
16th November, 20:37
Post: #5
|
|||
|
|||
|
RE: Changing HTML Content on Click & Remove/Reinit qTips
Wow, Craig! This is really close to what I was trying to do. Thank you so much.
It would have taken me a very long time to figure all of that out, if at all. Can't thank you enough. I'm late for something but I'll get back and update this reply this evening. As a side note, does it look like we can fade the colorpicker into the tooltip (clone) on click? I have no idea if it's possible but that would be too cool. |
|||
|
17th November, 09:46
(This post was last modified: 17th November 10:06 by ifthatdoesntdoit.)
Post: #6
|
|||
|
|||
|
Alpha slider qtip & opacity increase/decrease
Craig-
About the slider 'bars' not connecting with the handles until they're dragged, it seems to only be a problem on jsfiddle as they're working flawlessly on my site page. I've added two separate buttons to decrease and increase the opacity of the div#bg-color by 10% on click. The opacity of the div is changing but I haven't been able to 'animate' the #alpha-slider when the buttons are clicked. Here's the code so far: JAVASCRIPT Code
I was hoping to use .animate() to animate the background change at 1000ms but I couldn't get it to work. The tricky part seems to be that it would need to 'animate' on click of either the slider 'bars' or the color buttons, but stay current/immediate when being dragged. I was messing around with the following code using .animate() to no avail: JAVASCRIPT Code
and likewise for the opacity when the slider is clicked: JAVASCRIPT Code
How feasible would it be to have one half of the #alpha-slider background gradient, the solid half, update continuously as the RGB sliders are changed? Currently the solid color is white but it would be super cool if it was replaced by the current colorpicker result. Here's the css. CSS Code
I noticed that the green and blue .slider('value') portion of the code below were reversed somehow and that the sliders were 'animating' correctly according to each color, but the background colors were wrong. For example, blue was green and green was blue. I changed them around and everything seems right now. Just wanted to give you a 'heads-up' in case changing this might cause problems going forward. The order was 0,1,2... and now is 0,2,1. JAVASCRIPT Code
The qtips look awesome on the slider handles. The numbers are all spot-on and I am completely satisfied with how they're working now. That being said, just out of curiosity I was wondering how to get the .text characters changing as the handles are sliding/animating to their final value. Currently the selected value is show immediately, which is perfect. Lastly, what do you propose is the best solution for cloning the colorpicker into the tooltip? Is it workable? I was thinking that I could possible remove the qtip/tooltip for the clicked color button, then .removeClass and .addClass to bring in the colorpicker where the tooltip was. Thanks a million, Craig. Oops! Here's the updated live example: http://jsfiddle.net/ifthatdoesntdoit/fkFGn/11/ |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)

Search
Member List
Calendar
Help





It would have taken me a very long time to figure all of that out, if at all. Can't thank you enough. I'm late for something but I'll get back and update this reply this evening.