Page Reloads when I add attribute to div. Expected behaviour or not?

I’ve got a nice carousel with some slides. I am adding some attributes to my slide divs like this:

The strange thing that I am experiencing is that when I add these attributes, this causes the entire webpage to reload whenever a div with an attribute appears in the active slide.

View video explanation of the page-reloading issue here.

This page-reloading is not expected behaviour for the carousel I am using, it should not be reloading the page as part of its proper operation.

I can get this entire setup with this carousel to work smoothly in other websites or in a codepen, but while I am trying to rebuild it in Divhunt I am getting this strange issue with page reloading. (This is related to the other forum post I made about my question with the Anchor links not appearing in the URL, both ‘issues’ need to be resolved for my final goal for all this to work, which is linking to specific slides with buttons)

In the process of troubleshooting this, I need to ask if there in anything in the way that Divhunt works that could be causing the page-reloading. I have read that Divhunt works as a single page application, I am not familiar with the technicalities, just that this is in some way different to what I am used to, so am wondering if that plays any role with the unexpected page reloading I am experiencing. I also know there are some bugs still being evened out with the platform, so need to check those boxes before moving on to looking for other solutions.

Pleae advise if this could be in any way related to Divhunt platform or if I need to be looking elsewhere for the cause and solution to my carousel-button-linking woes.

Still stuck on this… adding data-hash="something" to a slide in my carousel causes the page to reload when that slide comes into view, not sure why that is happening - the page is not supposed to reload.

It is an odd question and issue, I know, but this is an obstacle I have run into and I would like to gain a better understanding of what the cause is and if it is in any way related to Divhunt, because what I am trying to do with my carousel and the data-hash works for me outside of Divhunt like in this example:


I guess owl carousel when you go to slide with ‘data-hash’ attribute, pushes /#hash to url, and that causes are system to refresh. I see you did some workaround without those hashes, are you happy with that now, or do we need to figure out a solution still?

1 Like

Hi, yeah my workaround was to customize the navigation ‘dots’ to to look like buttons.

Compared to not having buttons at all, it is great, but I am not really 100% happy with it because I am missing the ability to be able to link to a slide directly from somewhere else by using the #anchor-id in the URL, which I would like to be able to do to run ads for specific artists and have the right slide be visible when the visitor lands on the page.

About owl carousel and the #hash in the URL, it should not be listening for that unless you configure it with this: URLhashListener:true, the default state is that it will not be listening. I get the page reload though even when the URLhashListener is off. [Demo Page and info about this funtionality] So I thought it might be wierd for owl carousel to be pushing the #hash to url all the time even when the Url Hash Navigation feature is not being used.

In any case, on the demo page I linked, we can see that owl carousel is not triggering a page reload when you move to different slides by dragging.

So the one thing is the page reload, the other thing I am wodering about it what we spoke about previously, that the achor link buttons in divunt, the #anchor-id does not show in the URL when you click the button, and I think that owl carousel does expect this in order for it to work.

Here is a short video where I show where I have the config js file for that specific carousel and where I am adding the data-hash attribute, and go through the whole issue.