PDA

View Full Version : Add Background Dimming to existing script


johnMoss
09-05-2012, 06:10 AM
Hey guys,
I want to dim the background on load of a form. Oughta be simple and probably is but I've been playing with it all night & keep getting odd results. I've gone ahead & loaded the page, so viewable at
www.johnmossdesigns.com (http://www.johnmossdesigns.com)

Please disregard non-related discrepancies, site is under construction & no hurry on it :) .

1) Click the 'contact' link. Again, disregard appearance & placement, zeroing in on the dimming issue first.
2) Note the form pops up.
3) I simply want the background to smoothly fade to .7 or so & return after closing.

I've come close but no cigar just yet.

Thanx!

gentleone
09-05-2012, 02:07 PM
Hey John, I don't think you can dimm the background unless you add a black or any other colored transparent overlay ala lightbox on load of the form and remove it when you close the form.

johnMoss
09-05-2012, 03:40 PM
Thats another way of doing it and I found a script that worked, cept it was all CSS based & hence no easing... This is one of those things where by now I should be more fluent in js... Using any jquery 1.6 & up, I can't help but suspect adding one more function to call this action should work. I got pretty close last night... If no one here knows how to do it, I'll keep digging. I'm trying to avoid lightbox if i can...

mangofreak
09-05-2012, 04:09 PM
lightbox is preety nice to use or any variation of it - However, I have to say...replace your background photo with your avatar - you look scary :( The avatar - Friendly!

Sorry - I am a very sensitive T-rex

gentleone
09-05-2012, 04:18 PM
I'm not suggesting to use lightbox, but we can do something like an overlay ala lightbox :) It's not much js and css code to add to do this.
We both still share a folder 'site' on dropbox... just place all your files in a sub directory and I will have a try tonight.

johnMoss
09-05-2012, 04:36 PM
You look scary
Lol... I asked the girls, they said they liked it... Thought about using the original too... going for that Norton I'm all like serious & s___ look...8)

Guess I was tired last night... Forgot all about simple modal... duh... does exactly what I want, just a simple additional build out...

http://www.queness.com/post/77/simple-jquery-modal-window-tutorial

johnMoss
09-05-2012, 04:40 PM
G, thanks for thought btw... :)

johnMoss
09-07-2012, 06:12 PM
Hey John, I don't think you can dimm the background unless you add a black or any other colored transparent overlay ala lightbox on load of the form and remove it when you close the form.

I pulled it off after all. I have to admit playing with merging these two scripts has been full-on fun. Validation & action remain now, but thats the easy part.
I've also been experimenting with fluidity on this page & all works well until one opens in a browser with a lot of toolbars. Different elements seem to react differently; i.e. it appears one element will interpret screen percentage differently than others.
I have some reading to do...