Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bind unique links or something? #35

Open
CyrilKrylatov opened this issue Dec 1, 2013 · 5 comments
Open

Bind unique links or something? #35

CyrilKrylatov opened this issue Dec 1, 2013 · 5 comments
Milestone

Comments

@CyrilKrylatov
Copy link

Hello Beezee,

First of all, thank you a lot for this lil' plugin.

Secondly, I have an issue with it.

Indeed, I'd like to say to djax to only bind (then change via ajax method) only links on a DOM elements.

Let me clear this out if that's not (French guy, poor english here) :

I have:

<div class="menu">
<a class="menu__item menu--homepage" href="{URL homepage Site}">Go back to the homepage</a>
<ul class="menu__item">
<li><a href="{URL Portfolio}">Portfolio me</a></li>
<li><a href="{URL Contact}">Contact me</a></li>
</ul>
</div>

How can I say to djax to only bind the links from ul.menu__item but NOT a.menu--homepage ? Because I have an other template for my homepage and I don't want it to be loaded via djax.

Oh and I'm working with WordPress here.

Thank you for your concern.

@CyrilKrylatov
Copy link
Author

Well, I've figure sth out that should works:

I added this:

if (!$(element).attr("data-djax")) { }

In the .attachClick function.

Not sure if that's the best?

@beezee
Copy link
Owner

beezee commented Dec 2, 2013

@DaPo it's a good feature request, should be supported by an option you can configure without having to modify code. I'll try to look into this soon.

@CyrilKrylatov
Copy link
Author

@beezee yep, why not have the possibility to exclude .indexOf links AND DOM elements ? Or, on the last parameters, if there is, ONLY include DOM elements.

Should be great.

@beezee beezee added this to the next update milestone Mar 16, 2014
@akinayturan
Copy link

hi i found a solution for this prob but it's not a real solition :)

u can reload the page, just for index or inline "a" code where u use "rel=reloadpageopen" like a class and u sould add this code at the first

$('body').on('click', 'a[rel^=reloadpageopen], area[rel^=reloadpageopen]', function(e) {
window.location= $(this).attr('href');
return false;
});

@CyrilKrylatov
Copy link
Author

@epfarki sounds legit too, but I'm waiting for something more natural from @beezee :)

Thank you anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants