Toddish / Popup

A barebones, flexible jQuery popup plugin. Designed for developers, it's simple to use but very powerful.
http://docs.toddish.co.uk/popup
MIT License
146 stars 78 forks source link

I see the content of href #5

Closed mihai-craita closed 10 years ago

mihai-craita commented 10 years ago

Instead of seeing the content option in the popup, the popup displays the href attribute of the calling element. I am using a bare-bone example with only the content option filled up and type set as html.

Toddish commented 10 years ago

Hey,

Can you provide some example code?

After testing, if have this code:

<a href="#" id="popup-test">Test</a>

$('#popup').popup({
    content : 'http://placehold.it/240x240.png'
});

It all works as intended.

What do you have in your href?

mihai-craita commented 10 years ago

Hey,

thanks for replying.

check this out:

<a href="http://test.com" id="popup-test">Test</a>

('.popup-test').popup( {
    type: 'html', 
    content:'<h1>TITLE</h1>'
});

The content of the popup box is the same as the content of href. I believe the correct behavior would be to show up the content field.

Toddish commented 10 years ago

Ah OK, so the href is overriding the content if it's set.

Is there a reason you can't just set the href as '#'?

mihai-craita commented 10 years ago

I don't remember exactly why I needed the href to be different then '#' probably I was using it in another javascript call. I just think that this is NOT intended behavior and it may confuse other people also. So if you have time you could do something so that it works in this scenario also. Anyway, this Popup was eventually useful for me and it is very easy to integrate.

Toddish commented 10 years ago

Very true, all sorted.

Cheers :)

mihai-craita commented 10 years ago

Thanks mate!

Great job!