javascript - negative boundingClientRect value for text inside cufon and cufontext tags.. How to get positive boundingClientRect of That text? -


my code goes below...

 <cufon class="cufon cufon-canvas" alt="john " style="width: 59px; height: 24px;">    <canvas width="76" height="25" style="width: 76px; height: 25px; top: 0px; left: -1px;"></canvas> <cufontext>       <cufon class="cufon cufon-canvas" alt="john " style="width: 5px; height: 1px;">       <canvas width="6" height="2" style="width: 6px; height: 2px; top: 0px; left: 0px;"> </canvas>              <cufontext>john </cufontext>   </cufon> </cufontext> 

i need correct boundingclientrect object..

i trying below code giving negative value rect.left , rect.right..

if(documentnode.createrange){   var range = documentnode.createrange();   range.selectnodecontents(textnode);   if (range.getboundingclientrect)  {         var rect = range.getboundingclientrect();          if (rect)         {                              y = rect.top;                             h = rect.bottom - rect.top;                             w = rect.right - rect.left;                             x = rect.left;                     }             }     } 

pls help


Comments

Popular posts from this blog

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -