How to debug CSS with Firebug for an element that only appears when clicked? - css

I want to debug the CSS for a DHTML menu, but the element I want to debug is a submenu, so it only appears when the top element in the menu is clicked.
So I can't use that button on Firebug that shows the CSS for the next element clicked, because when I click on the top menu item it will show the CSS for that element, not its child, and if I expand the menu first and then click on the Firebug button the submenu disappears (it disappears when it loses focus).
Any tips on how to get out of this catch-22?

Use firebug console command line to run click event. Like $('#menutab a').click(); If it's needed, you could also set breakpoint to avoid hidding.
Read more in firebug documentation

Select your element in the HTML tab, directly in the source.
Then, you can hover your page to toggle it.

In cases like this I sometimes alter the script slightly in order for the 'hidden' element to stay visible.
In this case, I would perhaps comment out/disable the script code which hides the element on blur. That way you can click the main element, and inspect the now visible item for as long as needed.

What about debuging with all the buttons visible? Or you can still find the elemnt in the HTML tree.

In Opera, you can use Dragonfly (Tools > Advanced > Developer Tools, or Ctrl+Shift+i) to solve this issue. When the tools are active, clicking on any part of the page will navigate to that section of the HTML side-by-side with its CSS.

Related

Control position of accordion and how it opens when you use an anchor link?

I currently have anchor tags in my main navigational menu, which when clicked will open the corresponding accordion item below. The problem I am having is, when you click on the anchor link, the accordion will open 1/2 way down the inside content, and you cannot see the accordion header/title. It is almost like it opens at the bottom of the content.
Everything seems to work with no problems in Firefox and Chrome, but the dreaded IE will not behave.
Does anyone have any suggestions or ideas?
Thanks much!
Jen

how to see the styles applied during hover of an element in ie

Is there any way to view the styles applied during hovering of an element in Internet Explorer? Chrome and Firefox provide this in styles tab as we can see in console bar.
I want to know whether the same thing can be viewed in Internet Explorer. If so how?
Once you've pressed F12 and selected the element in question, you will be shown the CSS styles on the right - this does not however update when you hover over the element like in FireBug - nor can you set it's state as ':hover'. What you can do, is once the element is selected, ensure the focus is on the developer bar and hover over the element on the page - while hovered over it, press F5 - if you now reselect that element, the styles on the right hand side will show you the :hover styles ("Trace Styles" will also update)
In IE, you just press F12 and it will bring up the Developer Console. There you will find a CSS Tab.
Or after bringing up the Developer Console ( F12 ) you can use the pointer tool to highlight an element on your page and you will view the element Styles on the right pane of the Developer Console
http://www.sitepoint.com/debug-faster-with-f12-developer-tools-in-internet-explorer-9/
You can navigate to,
Tools >> DeveloperTools
Shotcut- F12
go to InternetExplorer menu : ->Tools->Developer Tools Shortcut : f12

What's the trick to inspect popout / dropdown menu style with Firebug?

Is there a way to make a popout menu 'stick' when inspecting with Firebug.
You can do it with Chrome, but I prefer firebug.
It's hard to set padding or a margin when you can't see the element you are styling.
I did some research but couldn't figure it out.
There's an option built in:
Inspect the element that's "hidden", then use this.
You can show/hide them using JS console, directly using show() or binding an event(mouseover, click etc).

How to use chrome web inspector to view hover code

Using chromes web inspector to view code is very useful. But how do you view for example the hover code for a button? You will have to hover the mouse over the button and thus cannot use it (mouse) in the inspector. Are there any shortcuts or other ways to accomplish this in the inspector?
Now you can see both the pseudo-class style rules and force them on elements.
To see the rules like :hover in the Styles pane click the small dotted box button in the top right.
To force an element into :hover state, right click it.
Alternatively, you can use Event Listener Breakpoints sidebar pane in the Scripts panel and select to pause in mouseover handlers.
Alternatively, you can use Event Listener Breakpoints sidebar pane in the Scripts panel and select to pause in mouseover handlers.
It's a little annoying, but you need to right click on the element, and then, keeping your mouse over the link, use your keyboard select the 'Inspect Element' link and press enter. This should show you the css for the hover pseudo class for the selected element.
Here's hoping they make this a little easier in future builds.
In Chrome:
You can also mouseover on an element, and then click CTRL+SHIFT+C to inspect that element.
In Firefox:
in firebug:
source: https://stackoverflow.com/a/11272205/2165415
I'm not sure that I right understand your question but if you want to see the event handler code you can just inspect the element and look at Event Listeners sidebar pane of Elements Panel.
Another way is just press pause button in Scripts Panel and just hover the element.
The debugger will stop at the first instruction of the first event handler.
Please have a look on below link for answer
See :hover state in Chrome Developer Tools

How can I observe the style on an element during mouse-over?

We supply micro-site content to a client. They supply us with a HTML wrapper and we inject our content into it. I'm trying to debug an issue where our style sheet appears to be interfering with the style in their wrapper.
Normally I'd use firebug or IE Developer Toolbar to select the element and I can see which styles are being applied, which are being overridden and where they are coming from. But this particular problem only exists when I hover the mouse over a link. Specifically, the link shrinks a little bit.
Is there anything that I can use to see what the browser is doing with the styles when I hover the mouse over the link?
Right click on the element. Select 'inspect element'. In the firebug html window click on the tag you're interested in. Hover over the element in page. You should see the style change to e.g a:hover

Resources