How to close a fixed div with javascript - hide

I have problem! I have just created a div with fixed position! I have put a close button for this div and i wanna if someone clicked on the button, the button would hide for just 24 hours, i wrote some codes to hide it but the problem is i cant set a time for it, can help me?

I don't know if you are still interested in the solution. You can do this using cookies. Write a cookie to the users browser for the time of the click (close button click), and next time he visits your site check the value of this cookie against the current server time to see how much time has passed since he clicked the close button.
For this to work, cookies should be enabled on your user's browser of course.

Related

Popup page remains activated even if the page is gone

if you click on the browser button, appears a page as a popup page.
with my program you can turn on music, from the body of the page.
when the window appears, music can be turned on, but when the window goes away, music is stopped.
does anyone have an idea how it stays turned, without popup appeared to stay?
Indeed when the popup goes away everything gets torn down.
Depending on how you play the music it might not be available in the background page either. Good luck.

SharePoint default modal dialog box not showing buttons

I've been doing searches trying to find help on this, but so far all I have found is how to set options for popping up a SharePoint modal dialog box from custom code.
However, I haven't created any custom web parts to display modal dialogs. What's happening, is if someone clicks the upload document button in a library, the upload document modal dialog comes up, but the ok and cancel buttons are half off of the bottom of the box. Users can click on them, but it just doesn't look very good.
I started playing with the CSS to make the modal dialog box bigger to reveal the buttons, and that works for the most part, but the real problem is the grant user permission dialog box.
When that is clicked, it doesn't show the ok and cancel buttons, and maximizing the dialog box doesn't reveal them. The user has to hit tab about 5-10 times before the focus moves to the ok button and is then clickable.
I would post an image, but I don't have enough reputation to do so.
Has anyone come across this? It seems very strange that the out of the box setting would have this problem.
The CSS that I use to adjust the height and width of the modal dialog is:
.ms-dlgFrame, .ms-dlgContent, .ms-dlgBorder, .ms-dlgFrameContainer
I'm just trying to set the height/min-height values, but I haven't had much luck.
We're using Internet Explorer 11 to view the pages.
Stevangelista actually pointed me in the right direction, I wish I could mark comments as answers, and since I'm new I can't upvote the comment, but here's the solution:
I am using a customized master page, and that comment had me take a look at the elements in the page.
Since the master page is being used in the dialog boxes as well, I used the s4-notdlg class to remove parts that weren't needed in the dialogs. Those parts were pushing the buttons below the bottom of the screen.
I'm not a css expert, so there may be ways of keeping those parts and still have the buttons accessible, but the particular issue I was trying to fix was resolved by using the s4-notdlg class to objects in my custom master page.

In XPages mobile app, how to avoid appending resetContent=false/true after pressing Done?

I've a mobile page developed with ExtLib mobile controls:
http://hostname/mydb.nsf/MobileTest.xsp
The page consists of two appPages (i.e. a "mainPage" appPage & a "subPage" appPage).
Click on an entry in the mainPage will move to the subPage. Click on the "Done" button in the subPage will move back to the mainPage. After moving back to the mainPage, the resulting URL will automatically change to: http://hostname/mydb.nsf/MobileTest.xsp#mainPage&resetContent=false
When this happened, if I press the browser's refresh button on my iPhone, instead of showing the mainPage, a grey blank page will be displayed. Then, if I manually remove &resetContent=false from the URL and press the refresh button again, the mainPage will be displayed properly.
So, is there any way to suppress appending &resetContent=false (or true) after clicking on a Done button?
I have found the cause of this and have put a fix into the ExtLib, it will be in the next release. I don't know when that will be at the minute but will update when I know
See answer:
http://www.openntf.org/internal/home.nsf/response.xsp?action=openDocument&documentId=0B41430C59FA242C862579D50034D72A

chrome extension popup not open immediately

I'm writing a chrome extension.
When i click the browser action button in the first time - all goes well.
When i click the browser action button the second time, after several minutes of not clicking it, it takes more than 10 seconds until the popup is shown.
I've tried commenting out all of the periodic methods in the background and all of the methods in the load event of the popup, but it still doesn't shown immediately.
any suggestions?
I had a similar issue with the popup when I was adding an iframe to the popup. Chrome would wait with showing the popup until that iframe was loaded.
For me the fix was wrapping the code that added the iframe to the HTML in:
setTimeout(function(){
// Code here
},0);
This way Chrome showed the popup first, after which it begin with loading the iframe.
Maybe you have a similar problem?
i have seen this behavior before when you have a long running ajax call that you are doing on popup load.. hard to tell further without code samples or description of what you are doing

Why do a browser don't block the screen when doing a postback?

Thought about it some times, and I decided to ask:
Why do a browser don't block the screen when doing a postback?
I have always been bothered by the fact that web browsers usually (can't say I've used them all) doesn't block the screen after I click a button that produces a postback. As I see it, during post a browser is expecting the server to send some information back. If it doesn't, the connection will time out and the page will be replaced by an error. If the server answer, it has to be with a web page; In other words, there's no possibility to keep the current web page rendered.
But it happens rather often that I click a button, realize that I forget to check a checkbox and so I click it, but to no avail. I know, I should have realized that clicking the checkbox wouldn't help, but hey, I usually doing stuff in auto-mode.
I think that it could be that the browser blocked the web page after you pushed a button or clicked a link that will produce a post back, so you couldn't press anything. But for some reason most browsers don't. Why?
The browser only shows what the page says and does what the script tells it to. If the page designer didn't implement anything to disable input during the connection, the brower leaves it up. In some cases this can be useful, such as when the input devices need to be available (although I can't think of a good example off the top of my head). A quick way to disable them (aside from disabling each individual input) is to have a hidden div with a z-index higher than the rest of the page become unhidden with a low opacity (screen looks slightly tinted, div prevents anything underneath it from being used) and then hiding it again when a response is received.
Ultimately it's just the result of a design choice. Does that answer your question?
When a browser blocks input is generally intentionally programmed that way.
Postback and clicking a button is not coupled because a button is not always used to do a postback.
Even when the browser is doing a request to some server in background, this request is not always fired by a button pressed (see Ajax)
In other words, there are much more complex scenarios than "push button, then postback", in order to cover every scenario, browser let this control to the programmer.

Resources