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

If Image Has Anchor Parent #20

Open
oliverbenns opened this issue Nov 15, 2014 · 0 comments
Open

If Image Has Anchor Parent #20

oliverbenns opened this issue Nov 15, 2014 · 0 comments

Comments

@oliverbenns
Copy link

For my blog I added a little bit of jQuery to check if the image element has an anchor as it's parent, and if so, don't generate the fluidbox anchor, rather, go to the Url of the anchor. Would like to see this added properly (we only have access to the minified version)

e.aTagWrap = function(t, n) {
        if (e.elemExists(t)) {
            var a = $(t);
            a.length > 0 && a.each(function() {
                var e = $(this),
                    t = e.attr("src"),
                    a = "";
                    if ($(e).parent('a').length > 0) {
                        return false
                    }
                    a = "<a class='" + n + "' href='" + t + "'></a>", e.wrap(a)
            })
        }
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

1 participant