Skip to content

Targeting a disappearing element for its CSS

Moved Let's Build It
  • Have you ever tried to target dynamic elements such as as Tooltips under bootstrap only to find that they disappear when you try to inspect them? You’re not alone.

    Fortunately (and inspired by this post), there is a workaround in case you find yourself in a similar boat.

    The Problem

    You locate the popover element you’d like to change, right-click then select Inspect Element and then element itself disappears - along with any hope of you finding the related CSS.

    The Solution

    We need to use a bit of ingenuity here. This is where the browser (in the case of Webkit, such as Google Chrome etc) debug facilities come in handy.

    1. Fire up the page where the element appears that you want to inspect
    2. Press F8 to open the developer tools
    3. Click on the console tab
    4. Paste the below into the console
    setTimeout(function(){debugger;},5000);
    

    Note that 5000 is adjustable (and the inspiration for the Mission: impossible - Rogue Nation sequence 🙂 ) It should look like the below - essentially, 5000 is 5 seconds… Now you see (hopefully) the paradigm.

    4f721beb-9f2f-42b2-8b64-c497df50eb98-image.png

    1. Now press enter
    2. You have 5 seconds before the debugger will launch, which should be enough time for you to active the element you want to target

    4741514b-83c0-4195-8d41-e673a8fbf36a-image.png

    1. Wait until the debugger fires

    6c706df4-ebbb-4d84-ae2e-2e25e63f5736-image.png

    1. Now select the element you want to inspect in the usual manner

    3d9cd04f-a769-41b7-a4f7-4524deb7e8b6-image.png

    1. Expose the CSS as required

    a55a0a2a-81af-401e-9ac4-69065c2f23d7-image.png

    Customise as necessary 🙂

  • phenomlabundefined phenomlab marked this topic as a regular topic on
  • phenomlabundefined phenomlab moved this topic from Configure on
  • Nice. Very good tips Mark 😁

  • phenomlabundefined phenomlab moved this topic from Guides on
  • phenomlabundefined phenomlab referenced this topic on

Related Topics
  • 3 Votes
    2 Posts
    130 Views
    Very great
  • 50 Votes
    107 Posts
    8k Views
    @crazycells [image: 1711908210287-7f4c7193-7c28-4e2e-80e8-d439ac7285c6-image.png] [image: 1711908232109-3ab9c33d-04b9-4c15-91e6-891450aebfc2-image.png]
  • Widget | CSS customization

    Solved WordPress
    53
    17 Votes
    53 Posts
    4k Views
    @Sala the only way you can achieve this is to use a robots.txt file and disallow access to those links.
  • 6 Votes
    15 Posts
    1k Views
    No no, I said that in the sense that he told me it was simple ^^ I was able to see that this was not the case by targeting the elements he had advised me.
  • hover link effect

    Solved Customisation
    18
    1
    6 Votes
    18 Posts
    1k Views
    @DownPW Looking at the underlying code, class start is being added on hover by jQuery in this function document.querySelectorAll(".button-gradient, .button-transparent").forEach((button) => { const style = getComputedStyle(button); const lines = document.createElement("div"); lines.classList.add("lines"); const groupTop = document.createElement("div"); const groupBottom = document.createElement("div"); const svg = createSVG( button.offsetWidth, button.offsetHeight, parseInt(style.borderRadius, 10) ); groupTop.appendChild(svg); groupTop.appendChild(svg.cloneNode(true)); groupTop.appendChild(svg.cloneNode(true)); groupTop.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); groupBottom.appendChild(svg.cloneNode(true)); lines.appendChild(groupTop); lines.appendChild(groupBottom); button.appendChild(lines); button.addEventListener("pointerenter", () => { button.classList.add("start"); }); svg.addEventListener("animationend", () => { button.classList.remove("start"); }); }); }) The CSS for start is below .button-gradient.start .lines svg, .button-transparent.start .lines svg { animation: stroke 0.3s linear; } And this is the corresponding keyframe @keyframes stroke { 30%, 55% { opacity: 1; } 100% { stroke-dashoffset: 5; opacity: 0; } } It’s using both CSS and SVG, so might not be a simple affair to replicate without the SVG files.
  • Blinking text Effect

    Customisation
    3
    5 Votes
    3 Posts
    478 Views
    @phenomlab I love it too @phenomlab said in Blinking text Effect: Has that “broken neon light” look that you see in films. It’s exactly that, kind of old neon signs of bar or pubs a bit cyberpunk too
  • 4 Votes
    8 Posts
    3k Views
    @DownPW done
  • NodeBB Design help

    Solved Customisation
    8
    3
    2 Votes
    8 Posts
    1k Views
    @riekmedia I’ve applied some new CSS to your site. Can you reload the page and try again ? For the record, this is what I added #footer { background: #2d343e; border-top: 4px solid #2d343e; font-size: 0.9em; margin-top: 70px; padding: 80px 0 0; position: relative; clear: both; bottom: 0; left: 0; right: 0; z-index: 1000; margin-left: -15px; margin-right: -338px; } The /categories page seems a bit messed up, so looking at that currently EDIT - issued some override CSS in the CATEGORIES widget <!--- CSS fix for overspill on /categories page - DO NOT DELETE --> <style> #footer { margin-right: -45px; } </style> That should resolve the /categories issue.