|
In my current project, the users need to post articles which may include programming codes. I wanted the code block (pre block) to expand on hover to its full width so that you don't have to scroll the contents to see the entire code. I was using mb hoverIntent() function but a problem came. I wanted the jquery to execute only if the code block's width is larger than width of the content: Please see the code and suggest changes:
|
The question has been closed for the following reason "The question is answered, right answer was accepted" by Matteo Bicocchi Jun 08 '11 at 15:58
|
Hi, Hoverintent is just used by the mb components but the author is Brian Cherne (http://cherne.net/brian/resources/jquery.hoverIntent.html); To solve your issue you can't retrive the .contents().width() via jquery; it fires an error. You should wrap the code inside the PRE with a CODE and then get the width of the CODE tag:
This should work. |


