I'll be posting a couple of questions as I learn how to use

Hi! I'll be posting a couple of questions as I learn how to use this plugin to achieve my aim. One will be about incorporating javascript into the window's content, as I'll explain, but let me start with a different question.

I want to replicate a feature I have in static Web pages on my site and used to have in WordPress before an upgrade, after which WordPress started stripping out onclick. I was using that within an a tag, with onclick set equal to a function, to create popup captions to images.

Now, I've enabled the rule in Pop Overs to make the condition a click. As I read down, I'm then to specify where people will click to get the popup. By default, it shows simply a. But I don't want every hyperlink in my WordPress posts to give the popup, just a specific hyperlink, the one attached to an image. Is that possible? Thanks.

  • Vaughan

    Hi @john,

    you can use any CSS class or id element.

    So if you want it to open when a user clicks an anchor tag with an id in.

    <a href="http://domain.com" id="popover">click me</a>

    so in the above anchor tag, we have an id of popover

    So in your click rule, you would enter

    #popover in place of the default a tag.

    Then it will open whenever a link is clicked that has that id.

    You can use class as well, but if you use class, then you use .popover instead of #popover

    Hope this helps

  • John

    Thanks. I added that condition (id) last evening to an unpublished post. I got it to show this morning in a "preview" of the post after changing settings from custom load. Again I'll have content questions. But here's what I noticed already in this first round of just getting something to show.

    First, the popup showed very briefly the moment the page previewed, then vanished. I don't want this, as it would look confusing. (Someone would surely ask, What's that?) The popup did properly show in clicking on the image.

    Second, it showed only the first time one clicks on the image. I have already hit the check box to disable things never showing after the first time, and I have not hit the check box to turn ordinary closings into never showing. This isn't a major drawback for me, but I do wonder what's happening.

    Third, I entered the test caption in html, and I see that something (Pop Up! or WordPress) then stripped out a line break. This may not matter in the end, as my content question will probably mean adding actual content as javascript, but we'll see. Advice for now? Again, I'll worry about customizing content with you once we get the test of showing something ironed out, and thanks.

  • Jack Kitterhing

    Hi there @John,

    Hope you're well today and thanks for the additional information.

    The one second delay would be good and I'd normally recommend a delay, rather than a instant pop up. :slight_smile:

    It also may not matter, as I get the feeling that the add-on will not be the best way to achieve the variable content I sought. Thus, I may never use it.

    Could you let me know how you'd like to use it and perhaps I can suggest a workaround. :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • Jack Kitterhing

    Hi there @John,

    Hope you're well today and thanks for the link.

    I've reviewed all the posts in that thread and this should be possible using the on click add-on included by default in Pop Up, as you add your element selector, a ID or class and then on click of that ID or class it pops up.

    But one thing I wasn't 100% sure on was did you actually need variable content within the pop up itself? As doing it via the above method would mean that each piece of content/image has it's own unique ID we can use for the on click selector element.

    Please advise. :slight_smile:

    Thanks!

    Kind Regards
    Jack.

  • John

    Jack, as you could probably guess, I indeed had been using the on-click selector, and my question here was about its apparently violating that rule by trying momentarily to display the popup without a click, which people here very helpfully suggested that I suppress by a time delay to cover that moment.

    As for content, yes, I meant that I'd been using javascript, with popcap set equal to a function with three variables, to feed content into a popup. It's described at greater length in another thread, but the idea is that I'd been using popups (as well as mouseovers from plain old html name and id attributes) to provide figure legends without having to create a table for each figure with legend displayed there, also with the advantage of simplicity of appearance, just align and border attributes sufficient to get text to wrap around art neatly. The variables were for artist, title, and source/date.

    This is much superior to creating a new popup with Pop Up! for each image. First, it's so much easier. Second, it'd mean I'd have hundreds or perhaps even over a thousand distinct popups by now, a nightmare in every regard, from the bloated WordPress content to managing them. What if I ever wanted to locate, rewrite, or reuse one? Sorry, this is just not the way to go.

    While I won't be likely to use the product, I embrace the $19 it's cost as a learning experience, plus a great introduction to you guys! My thanks again, and maybe I'll post another WordPress question unrelated to the popup window while I have such a great source of wisdom.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.