jquery - Fade Out the background only -


when click button hidden image shown. problem have want (now) background faded or blackened , happening faded including shown image.

show hidden image

how fadeout background?

<div id="chart" style="text-align: center;display:none;position:fixed;z-index:-100;">     <img src="/donor-radar-chart?radar=%5b%5b%22w.feather%22%2c0%2c26635692%2c240660%5d%2c%5b%22jesterium%22%2c6%2c26297636%2c668476%5d%2c%5b%22ocfthanks%5bh%5d%22%2c6%2c19286508%2c8442507%5d%2c%5b%22wyluliraven%22%2c11%2c23246906%2c2486642%5d%2c%5b%22quisarious%22%2c21%2c15048498%2c4027046%5d%2c%5b%22breeze%22%2c22%2c23116432%2c1369416%5d%2c%5b%22filter%22%2c40%2c27698092%2c54722%5d%2c%5b%22axiomatic%22%2c70%2c16109511%2c1287889%5d%2c%5b%22dej915%22%2c80%2c21659570%2c677966%5d%2c%5b%22rig0r_m0rtis%22%2c84%2c29503180%2c1212%5d%2c%5b%22daggerhead%22%2c103%2c2553248%2c1880421%5d%5d"         width="640" height="300" class="imgchart" alt="donor radar chart"         />     </div>  <div style="background-color: #fafafa;">     <table class="radar" id="radar" width="100%">         <thead>             <tr>                 <th colspan="2">overtake</th>                 <th rowspan="3">challenging member</th>                 <th colspan="10">challenging member stats                     <span>                         <input type="button" value="chart" onclick="                             var $body = $('body');                             var $chart = $('#chart');                             var left = math.floor(($body.outerwidth() - 640) / 2);                             var top = math.floor(($body.outerheight() - 300) / 2);                             $body.fadeto('fast', 0.5);                             $chart                                 .css('left', left).css('top', top)                                 .css('z-index', '100').fadeto('fast', 1);                             $chart.on('click', function() {                                 $chart.fadeout('fast');                                 $body.fadeto('fast', 1);                             });                             "></span>                     </th>                 </tr> 

it's simple. easiest way: first - throw out

$body.fadeto('fast', 0.5); 

and

$body.fadeto('fast', 1); 

second - add styles chart element:

<div id="chart" style="text-align: center;display:none;position:fixed;z-index:-100; width: 100%; height: 100%; background: rgba(0,0,0,0.5); top: 0px; left: 0px;"> <img src="/donor-radar-chart?radar=%5b%5b%22w.feather%22%2c0%2c26635692%2c240660%5d%2c%5b%22jesterium%22%2c6%2c26297636%2c668476%5d%2c%5b%22ocfthanks%5bh%5d%22%2c6%2c19286508%2c8442507%5d%2c%5b%22wyluliraven%22%2c11%2c23246906%2c2486642%5d%2c%5b%22quisarious%22%2c21%2c15048498%2c4027046%5d%2c%5b%22breeze%22%2c22%2c23116432%2c1369416%5d%2c%5b%22filter%22%2c40%2c27698092%2c54722%5d%2c%5b%22axiomatic%22%2c70%2c16109511%2c1287889%5d%2c%5b%22dej915%22%2c80%2c21659570%2c677966%5d%2c%5b%22rig0r_m0rtis%22%2c84%2c29503180%2c1212%5d%2c%5b%22daggerhead%22%2c103%2c2553248%2c1880421%5d%5d"     width="640" height="300" class="imgchart" alt="donor radar chart"     /> </div> 

now, chart takes screen width , height , has own transparent background covers under chart :) hope help.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -