JavaScript - Grey Box - Open Only On 1st Visit
I have a site using Grey Box pop up ( http://therdkgroup.com/) . It automatically pops up when you go to any of the 5 pages on the site.
Is it possible to add a cookie to it so that it only pop up the first time someone comes to any one of the pages? If so, can you point me in the right direction on how to solve this?? Similar TutorialsWhy fail? --> <span onclick="document.bgColor = 'grey';">Grey</span> <span onclick="document.bgColor = 'grey';">Grey</span> does not change the page grey on this page: u s e r s (dot) r c n (dot) c o m / r o b e r t (dot) a c k e r t / g r e y . h t m any ideas why? I think something is blocking it. Hello all; I am doing a site for a local business that uses radio advertising and has a jingle that they want to play once per visit only (so it does not play over again of they return to the same page later that day). I have tried to use yahoo player, Google player and the infamous wma player and all work well. I especially like the yahoo player but as will all the players I could not find a way to have it only play once per day per visitor. Is there a way to accomplish this? I was thinking using a tracking cookie but have no idea how to implement it. In the end I would like to accomplish the following: mp3 plays automatically on page load audio only playes once per day per visitor hava small player so if the visitorr wants to hear the jingle again they can do so. the player should be compact and cross browser compatible. Should be compatible with HTML 5.0 Transitional or at the very least 4.01 Any help would be appreciated. Hello. I'm trying to set up a login formular with PHP and JavaScript/jQuery. Currently it sends an alert box, if some information are wrong. If correct, it refreshes the page, and everyone's happy. However, I noticed upon the first visit, I cannot log in. Lets say I go to www.mysite.com and try to login, it displays a blank alert box, when it's suppose to display the username, that I supplied, and is wrong... however, it's blank. BUT! If I go to another page and login with false informations, an alert box with the wrong username pops up - if I login with correct informations, it works. How come it won't work on first visit? What am I doing wrong here? Pressing F5 won't work either - I have to manually switch to another page for it to work. Any suggestions and ideas are welcome and appreciated. I'll supply the codes necessary for anyone to help me, but at this point I'm completely blank on which of my codes may be the problem. EDIT - IMPORTANT INFORMATION! Now THIS is weird! I just noticed it's because there's not www. in the URL. There has to be www. for it to work, why is this? I forced the client to have www. in the URL with .htaccess, but I'd still like to know, why this problem occurs without it. Hi all, I'm trying to find what I'm sure is a simple bit of js which I can use that will close a div for the duration of a users visit as it would hide a notice I'd only want to display once on a site. Essentially all I'd want to do is have a simple div with a paragraph and a link to close the div but to have it remember across pages that the user has dismissed the notice. I noticesearched around and found a similar request here but I don't know js enough to replace the inputs in the example to a simple link and to remove the show div functionality. Anyone able to provide me with any pointers on how I'd be able to achieve this? Many thanks, J. Hello there, Can some one gimme source code for greying out a button on php page. In my application i have one play button and one stop button in the html form. If i click play button it will update database with play and invoke a script. similarly with stop. so while they are being played i want this play button to be greyed out. or is there any way that i can only show stop button while playing and play button while not playing the files. HELP PLZZZZZZZZ I was changing the code on the Grey Box script to pop up only the first time someone came to the page. The original code that controls this is: Code: AJS.AEV(window, 'load', function() {GB_show("The Kinniebrew Group", "http://therdkgroup.com/id18.html"); } ); and to make it work just the first time someone visits the page I changed to read: Code: AJS.AEV(document, 'load', function() { // look for our strangely named cookie: if ( document.cookie.indexOf("zz1rr_xxG") < 0 ) { // if not found... document.cookie = "zz1rr_xxG=yes"; // set it for next time...without expire so session only // and show the box: GB_show("The Kinniebrew Group", "http://therdkgroup.com/id18.html"); } } ) I had this line of code working but it doesn't now after I did something to it. does anyone have an idea how I can modify this to make it work? Hi there, I was wondering if there were any scripts (or if you could build be one) which allow first-time visitors to read through step by step tooltips which explain features of a system. For example, users could click on "next" to make that tooltip dissapear, and the next tooltip reappear. ANy help would be great, Thanks Hi! First post here! Would really appreciate some help on a javascript that would display the time elapsed since a particular visitor last visited my webpage, using cookies. So basically it should show something like: "You last visited my page 2 days & 12 mins ago!" I've a little background in java but none in javascript... Thanks so much! I was trying to display time of last visit along with login name.. can someone help me on this pls? My google maps is showing a grey box and no map?! Please help me, I got my code from he http://www.powerhut.co.uk/googlemaps/custom_markers.php and uploaded everything to the right place but it's just grey?! http://79.170.40.235/affordableappli...uk/contact.php <script type='text/javascript'> $(window).load(function () { $('area').each(function (e) { var area = $(this), alt = area.attr('id'); if (alt != null) { area.mouseenter(function () { var newImage = $('<img />'); newImage.attr('src', 'ReadImage.ashx?id=' + alt); // call handler with id $('.display').append(newImage); }; } e.preventDefault(); }); }); </script> <div class="display"> </div> <img src="3rd_Floor_screen-size.jpg" width="1372" height="906" border="0" alt="" usemap="#Map" /></div> <map name="Map" id="Map"> <area id="1" alt="1" class="tooltip" shape="rect" coords="28, 87, 93, 181" href="#"/> <area id="2" alt="2" class="tooltip" shape="rect" coords="95, 91, 172, 158" href="#"/> <area id="3" alt="3" class="tooltip" shape="rect" coords="175, 90, 225, 157" href="#"/> </map> I am gettting image on mouseover, if i over the mouse on area id =1. That id 1 will be passed to the ashx page through the script. The ashx page returns my image from the database. I am loading that image in the div display. Now what i need is i have to display the image as a tooltip not in a div........ For example: Visit this following website. http://visitmix.com/labs/glimmer/samples/tooltip.html Can anybody suggest me a solution to do this? I know there is an easy way to do this...... i have brought 60 percent. Now what i need is i have to get this image as a tooltip when i move the mouse over the area id =1.. Thanks Hello everybody, how can i grey out a whole page, and focus attention on a div only? are there any good scripts? please help. EDIT: actually what i want to do is: click a button grey out all my page and show a loading gif load, thru ajax, content from external source turn off grey and loading gif update current page content. I have a form with a text box that is greyed out unless a checkbox is checked. The problem is if the checkbox is checked and this enables the text box to enter data and I hit reset, the text box does not reset and turn grey. It allows data to be entered. I have both the html reset button and the javascript clear form, but neither seem to work. How do I reset the text box to grey as well if reset is hit? Code: <form method="post" action="" name="resetproblemform" enctype="text/plain" onReset="return confirm('Do you really want to reset the form?')"> <div>Check Which Apply: LineTest1<input type="checkbox" name="status" value="1" style="margin-left:10px; margin-right:40px" onclick="this.form.line1test2.disabled = !this.checked;"/> Line1Test2<input type="text" name="line1test2" style="margin-left:10px; margin-right:67px" maxlength="9" disabled="disabled" size="9"/> </div> <div class="break10" style="margin-left:140px"> Line2Test1<input type="checkbox" name="status" value="3" style="margin-left:10px; margin-right:40px" onclick="this.form.line2test2.disabled = !this.checked;"/> Line2Test2<input type="text" name="line2test2" style="margin-left:10px; margin-right:67px" maxlength="9" disabled="disabled" size="9"/> </div> <div class="break10" style="margin-left:140px">Line3Test1<input type="checkbox" name="status" value="5" style="margin-left:10px"/> </div> <input type="submit" value="Submit" /> <input type="button" value="Reset JAVA" onClick="this.form.reset()" /> <input type="reset" value="Rest HTML" /> </form> Hi everyone. New to javascript here.... I have a problem here. I know how to store a cookie and check a cookie... but i don't know how to calculate the time between current visit and previous visit... Example. I logged in @ 1pm and logged in again @ 3pm... It should a msg like "your last visit was 2 hours ago" Can any one enlighten me ? Thank you! Can a random page be loaded without a prior visit to a site? I have a list of 15 people with a photo and contact information in a table with 3 columns and 5 rows. The issue is that the people near the bottom want a chance to be at the top the first time the page is viewed. It is unlikely that a second visit would happen. Is this possible to load a random page for a site without it being viewed or logged into before, therefore no cookies will be used. My knowledge of Java script code is limited so any help would be great. Thanks Motty Hi All, I m newbie on JavaScript Coding. I have Form where the there are 4 radio buttons. Requirement is OnClick of Each radio buttons, some Div must Greyed out. <input type="radio" name="cf_basic_type" value="Apartment" checked="checked" />Apartment <input type="radio" name="cf_basic_type" value="Villa" />Villa <input type="radio" name="cf_basic_type" value="Independant" />Independant house <input type="radio" name="cf_basic_type" value="Plot" />Plot</div> and Grey Part of Form is: Area Size:<input type="text" name="cf_area_size" id="cf_area_size" /></div> Plot Size:<input type="text" name="cf_area_length" id="cf_area_length" /> <input type="text" name="cf_area_width" id="cf_area_width" /> so for Plot radio selected the 'Area Size' must be greyed out but when others radio button selected is must be active For Apartment radio selected or Villa radio selected, Plot Size must be greyed out. Hope that makes clear.... Its very Urgent kindly help me with this.. Thnks in Advnce Hi, I want to restrict opening my popup window if it is already opened. For simple scenario, it is quite possible to do but in my case -- 1) When parent page is opening popup window, it is getting refreshed (required from client for some reason). 2) Once submit button is clicked from popup window, again parent page is getting refreshed (again its a requirement from client side). With these 2 conditions, I lost my saved value from variable and hence new popup is keep coming when the action is same. Currently I am using below code to open popup [CODE] function OpenWindow() { if(winPop && !winPop.closed) { alert("Popup is already open"); } else { winPop = window.open('MyPopupPage.aspx'); } } [CODE] Please help me to get rid of this problem. Thanks in advance. - Bhasker I do write some php, but have not much idea about JavaScript. I use window.open to open 10 pages simultaneously. I prefer to open them with a time delay from each other to put less load on the target server. This is my code with no delay. (I played around with setTimeout but can't get it to work.) PHP Code: <a href='http://www.".$new[9]."' onclick="window.open('http://www.".$new[0]."/'); window.open('http://www.".$new[1]."/'); window.open('http://www.".$new[2]."/'); window.open('http://www.".$new[3]."/'); window.open('http://www.".$new[4]."/'); window.open('http://www.".$new[5]."/'); window.open('http://www.".$new[6]."/'); window.open('http://www.".$new[7]."/'); window.open('http://www.".$new[8]."/')\" target='new300/'>Open 10</a> window.open() doesn't open an entirely new window in FF3.6, just a new tab suggestions? Edit: Yeah, ok, so if i specify a size smaller than the current standard window, it'll be forced to open a new window. but what if i want a new standard sized window to open entirely? and in any case, i wan t amore direct solution where possible, thanks. Hi, i'm very new with JS and have no idea where to go with this. Basically, i'm looking to have a dropdown menu open in new tab once clicked on Go To URL button. Here it is. Code: <div id="drop_box_nav"> <form action="#" onsubmit="return go_nav();"> <select name="my_links" id="my_links"> <option value="url">name</option> <option value="url">name</option> <option value="url">name</option> <option value="url">name</option> </select> <input type="submit" name="sub_nav" id="sub_nav" value="Go to URL" /> </form> </div> <script type="text/javascript" src="subnav.js"></script> This should be extremely simple for most of you but i'm know squat about JS. Thank you. |