Answer the question
In order to leave comments, you need to log in
How to make image view from modal window?
Such a problem. On the main page there is a slider of quotes of posts of a certain category. When you click on a button or title in a Bootstrap modal window, the post itself opens (without reloading the page). There are almost always several photos in the record and you need to organize their beautiful viewing. I tried a bunch of galleries (both plugins and "handles installed" scripts), the result is the same - nothing works. Either the bootstrap crashes and the window does not open at all (at the same time, another half of the page stops working, this happened when installing non-WP plugins), or there are no changes, that is, the pictures simply open in the browser tab, as if there is no plugin.
I've been struggling with this for almost a week, I still couldn't come up with anything.
Here's some more information, in case it helps:
1) a one-page site, with a possible expansion in the future. Those. while it is not supposed to view posts on separate pages, only in modals. The whim of the customer, could not convince.
2) the theme is completely self-written, made on bootstrap (+ jQuery).
3) the content of the post is loaded into the modal like this:
function load_post(ID) {
$('#post-title').text($('#caption-title-'+ID).text());
$('#post-content').load("./?p="+ID);
};
Answer the question
In order to leave comments, you need to log in
Perhaps your pictures are loaded and created by a script, the handler is not hung on them and therefore nothing happens. Add an image not in the modal window, but simply in the body of the site, and test how it will open there. If this is the problem, then the usual scripts of modal windows will not work for you, either write it yourself or change the way images are loaded. As an option (if there are not too many posts with pictures), immediately display posts via PHP and make them hidden. In general, it would be better if they gave the address of the site.
I would make the structure like this, the posts themselves are there and displayed on the site, but they are not visible to the user, and we push the single post page into the modal to display the page itself.
But in general, plugins have their own js and css script, right? and on the page they are connected to you? if so, is the required markup for the div in the modal respected.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question