Note that there are some explanatory texts on larger screens.

plurals
  1. POError trying to get jquery-ui tabs working on a div inside of leaflet map
    primarykey
    data
    text
    <p>I need to get jquery-ui tabs functionality working on a div. The div lives inside of a few other elements. It's html bound to a popup marker in a leaflet map.</p> <p>Here is the html I'm using. <strong>I know this html works</strong>, as you'll see in the next picture.</p> <p>Here's a picture of the problem. The html for both the top div and the div in the popup are <strong>identical.</strong></p> <p>Also, my script is called like this:</p> <pre><code>$(window).load(function() { $( ".detail-popup-info" ).tabs(); }); </code></pre> <p>I did that because I wasn't sure if the actual DOM was finished before that got called, but it looks like it didn't really help. I think the issue might have something to do with inheriting lots of other properties? When I inspect the css properties, they look totally different.</p> <p>The top div i'm guessing doesn't inherit anything since I hard defined it in the html page. The other div, in the popup, is sent in as a string to a function and probably gets shuffled around.</p> <p><img src="https://i.stack.imgur.com/91T20.png" alt="popup error"></p> <p>Here are the css properties of the broken one:</p> <pre><code>background-color: rgb(255, 255, 255); cursor: auto; font-family: "Helvetica Neue",Arial,Helvetica,sans-serif; font-size: 12px; font-size-adjust: none; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: 400; height: 100px; line-height: 16.8px; text-align: left; width: 200px; -moz-font-feature-settings: normal; -moz-font-language-override: normal; </code></pre> <p>Here are the css properties of the working one:</p> <pre><code>background-attachment: scroll; background-clip: border-box; background-color: rgb(255, 255, 255); background-image: url("http://localhost:3001/stylesheets/images/ui-bg_flat_75_ffffff_40x100.png"); background-origin: padding-box; background-position: 50% 50%; background-repeat: repeat-x; background-size: auto auto; border-bottom-color: rgb(170, 170, 170); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; border-bottom-style: solid; border-bottom-width: 1px; border-image-outset: 0 0 0 0; border-image-repeat: stretch stretch; border-image-slice: 100% 100% 100% 100%; border-image-source: none; border-image-width: 1 1 1 1; border-left-color: rgb(170, 170, 170); border-left-style: solid; border-left-width: 1px; border-right-color: rgb(170, 170, 170); border-right-style: solid; border-right-width: 1px; border-top-color: rgb(170, 170, 170); border-top-left-radius: 4px; border-top-right-radius: 4px; border-top-style: solid; border-top-width: 1px; color: rgb(34, 34, 34); font-family: Verdana,Arial,sans-serif; font-size: 9.6px; height: 100px; padding-bottom: 1.91667px; padding-left: 1.91667px; padding-right: 1.91667px; padding-top: 1.91667px; position: relative; width: 200px; -moz-border-bottom-colors: none; -moz-border-left-colors: none; -moz-border-right-colors: none; -moz-border-top-colors: none; </code></pre> <p>I guess that's kind of the weird part. The working one has many more css properties than the broken one. Maybe <em>jquery-ui</em> applies some extra properties to it to make it work, but for some reason it isn't applying them to the popup div?</p> <p><strong>Update</strong></p> <p>So I guess it turns out jquery actually isn't finding the divs inside the popups because they are dynamically added and removed from the DOM every time one is opened or closed. Here's a picture of the html without the popup opened. Normally, they reside under <code>leaflet-popup-pane</code>, which is empty.</p> <p>Maybe I'll have to resort to hard-copying the css properties of the working one and applying them manually to the popup divs.</p> <p><img src="https://i.stack.imgur.com/eG8ue.png" alt="enter image description here"></p> <p><strong>Update 2</strong></p> <p>Just confirmed it's because the popup html doesn't exist in the DOM. I did a <code>setTimeout</code> on the jquery-ui tabs() function and quickly opened one and it styled it correctly.<br> But once I close it and reopen it, it's gone again.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload