Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ANBA1992

    (@anba1992)

    Hiya,

    Basically I have a problem. I bought the Ozy WP Cloud template and they dropped me without helping me at all. I have no idea how to code and I feel really stupid, so I try to solve the problem on my own now.

    When I uploaded my images to my website, into the owl carousel, the images were not repsonsive and loaded in a smaller format, and after 1-2 seconds snipped into the actual position. After intensive research I found out that another guy had the same problem and solved it by calling the DOM first and then the owl carousel.

    Now the question is, what is a DOM?
    And how can I call the owl carousel after the DOM?

    I would really appreciate your help.

    Cheers,

    Andrej

    Reply

    Moderator bcworkz

    (@bcworkz)

    Document Object Module
    https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model

    I’m not sure what “calling the DOM” would mean. I’m guessing this is referring to Javascript in some way, but the DOM there is available as document, there’s no need to call it. Calling the carousel makes more sense, there’s probably some code that needs to execute to get it to work. My best guess is the carousel code should not be called until the page has fully loaded.

    In WP, all JavaScript should be enqueued in PHP with wp_enqueue_script(). You can specify code be loaded in the footer, so that it loads last, by passing true as the last $footer parameter.

    There’s also a JavaScript event that fires when the page has loaded, you could call the carousel code upon this event occurring.

    Thread Starter ANBA1992

    (@anba1992)

    Sounds great, thx.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How execute DOM before the Owl-Carousel?’ is closed to new replies.