jquery centering span on image hover (because it is inline maybe?) -


When the content comes to the user, I am trying to make fancy hover effects when the content appears. I want the bubble to be centered and go to the top of the images.

Illustrated in this Bela:

In Chrome it is particularly bad, where the duration is automatically turned on to display: Inline hover behavior differently from Firefox Does the block element help in both form but the hidden elements are pan and it is displayed automatically: inline. Any thoughts and hover about fixing this problem appear directly at the top of the right pictures?

Thank you!

CSS change:

  #features_icons li span {top: 0; To set in / * /// Chrome, go to /// * / left: 0; / * /// Added to fix in Chrome /// * / white-space: nowrap; / * /// Added this line // / * /} # feature_conle (status: relative; / * /// This line was added /// * /}   

and inside jquery I just added: external dimension (true) get correct dimension To:

  spanW = ($ (this) .next ("span") External Wide (true) / 2) - ($ (this). Otterwidth (true) / 2 );   

You can also try: all your & lt; SPAN & gt; Remove elements A different perspective:

In any case, your icons have an alt attribute Why do not span the text in each image: (Add a alt details text to images (no CMS editor allows you to.)

  & Lt; Img alt = "air conditioning" src = "http: console.png" />   


You can remove all your span, & lt; Body & gt; Tag:

  & lt; Div id = "tooltip" & gt; & Lt; / Div & gt;   

and use my script:

  $ ("ul # features_icons li img"). Hover (function () {var altteext = $ (this) .attr ('alt'); var thisW2 = $ (this) .terwidth (true) / 2; var it posl = $ (this) .offet (). Left + ThisW2; var This POST = $ (this) .offet (). $ ('# Tooltip'). $ ('# Tooltip'). Text (altteext); var tool W2 = $ ('# tooltip') External Wide (true) / 2; (1) .FadeTo (200,1) .css ({left: (ThisPosL-toolW2, top: thisPosT})}}, function () {$ ('# tooltip'). FadeTo (100,0, function) {$ (This) .hide ();});});   
  • This icon will calculate status
  • Fill alt text
  • # tooltip
  • Get tooltip width
  • set the status of #tooltip
  • Show it more!

    PS: I was just given the name in your CSS: #features_icons li SPAN { to #tooltip { < / Div>

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -