how to load modal when click a link without refresh - php

I have index page with some modal box.
these modal cause page become very untidy and bad effect when page loaded.
Now this is my question,how can i load that modal when click that link without refresh,i do not have any modal in index page at first,by click i include that modal?
I use laravel 4 framework,some guys say it is possible by event in laravel,is it?

Related

How to reload a parallax page to the top section on browser back button In parallax?

I have implemented parallax in my website with animation and dynamic data in down section. But when I move to another page and come back to same page with browser back button i lost all my dynamic data and animation, I brought from DB.
I want to reload a page when user clicks back button so that user will be in top section.

close modal after submit of form on redirect to same page

I have a form inside a modal that automatically opens on load. the form submits the time to a database when it is activated which starts a timer to evaluate how long it takes a participant to complete a task on the page. The page redirects to itself when the submit button is clicked as the events to be measured are on the opening screen. However when the page is reloaded the modal opens once again. How would I stop the modal from opening again on the submit of the form and reloading of the page? I have everything working but this part. I am using basic jquery. Nothing fancy.
Add destination url for your link. Get more help from below urls:
https://drupal.stackexchange.com/questions/66707/how-to-redirect-to-another-page-after-submitting-the-ctools-modal-form/108040#108040
https://drupal.stackexchange.com/questions/29157/redirect-form-out-of-modal-window-after-submit/108039#108039
You could redirect to the same page with an added query string value that stops the modal from being displayed.

codeigniter reveal modal load once per session/cookie

I have a modal window that loads on index page using the following command,
data-reveal-onready="Register"
$(document).ready(function () {
$('[data-reveal-onready]').reveal();
});
I want to add a php if statement on the data-reveal-onready to load only once per session on the homepage and when the user visits the homepage again it will not appear on load.
The modal is a registration form so obviously the modal window may be needed again and it will still show when clicking on register button.
I am using codeigniter and reveal modal.
Many thanks
Perhaps use CI's session class?
// Initialize on visit
$this->session->set_userdata('register_pop_up', true);
// Check
if ($this->session->userdata('register_pop_up'))
{
// Don't display in the future
$this->session->unset_userdata('register_pop_up');
}
You could also use cookies to set the modal window. That way if a user comes to your site, gets the modal window, leaves and comes back before the cookie expiration, they will not get the modal window again.
http://ellislab.com/codeigniter/user-guide/helpers/cookie_helper.html

how can I get just a single div to refresh on submit as apposed to the entire page?

Merged with how can I get just a single div to refresh on submit as apposed to the entire page?.
I am working with a dynamically generated page written in PHP. The page contain contents listed, while clicking the edit link a new page will open as popup using fancybox . Once editing is complete and the user closes the FancyBox modal the changes need to be reflected on the parent page.
Right, so I was able to find a solution that refreshes the entire page on submit using
parent.location.reload (true);
to refresh the entire parent page. But, that causes a browser prompt that is confusing to users and a bit of over kill as I really only need the information edited to refresh.
how can I get just a single div to refresh on submit as apposed to the entire page??????

Running jQuery command from modal window to affect main page

I'm currently trying to write a jQuery script which opens a modal box then (upon user entry) changes a value on the original page.
Currently I've got the script working on just the page itself (without the modal), but when I try to run the command from the modal the value on the main page doesn't change?
Does anyone know how I can solve this?
Thanks,
Tom
Make a function in the page itself (not the modal sub-page), then call opener.myMethod() in the modal sub-page.
If the modal dialog is using an iframe, then from within the iframe you can do either of the following (depending on whether you have nested iframes or whatnot).
window.parent.myMethod();
top.myMethod();
And to access elements on the main page you could do this (assuming you have jquery included on the main page as well):
top.$('#myDiv').html('hello world');
Hope this helps.

Categories