Script To Show Div Based On Referrer Within The Same Site?

May 9, 2010

I have very little knowledge of javascript, other than modifying existing scripts, and I can't find anything about this particular problem. creating a simple script that will display a div ONLY if the user comes from a certain page within the same site.

Not sure if that was clear, but let me try with specifics. There is a link to a page called 'Clients' on the 'About Us' page. If a user goes directly to 'Clients', they should have a normal experience. If, however, they come via the 'About Us' page, I want to display a div at the bottom of the page that will take them back to the 'About Us' page.

I know how to get a referrer, and I know how to show/hide divs. I just don't know how to combine the two.

View 3 Replies


ADVERTISEMENT

Thinking Out Referrer-Based Info Swap?

Nov 14, 2011

i was hoping to get some help with just figuring out how I should tackle an issue I'm having. I am pretty good with php and javascript, but no expert. Anyways, I have a site where I am wanting to swap some info around the Wordpress site, based on the referrer domain.

More specifically, when a user comes from craigslist.org/anything/ , I need to be able to make a substitution of a couple of html elements during their session. Very likely I will be making that substitution through some combination of js and php - right? - but I'm not quite confident in how I should start off. The site in question is [URL]...

If anyone just has any theories about how this should work, then PLEASE share them! And if you have a code snippet that might start work in this direction, that I can modify and play with, then PLEASE share that as well,

View 2 Replies View Related

JQuery :: (.) Period In Value Field - Show/hide A Div Based Based On The Selection Made Via A Dropdown

Apr 9, 2010

Im using a jQuery script to show/hide a div based based on the selection made via a dropdown.

<script type="text/javascript" src="jquery-1.3.2.min.js"></script>

The problem im having is that the value used in the dropdown lists are price values eg 10.00

Consequently jQuery seems to interprit these as css notations, meaning the code doesnt work.

View 4 Replies View Related

Create Multiple Clocks On Site Based On The Client Location

Feb 9, 2009

I need to create multiple JavaScript clocks on my site based on the client location (I.e. Los Angeles, Houston, Orlando, etc). Nothing complicated... just text clocks to show the current time. With due credit to this site , I used their code as a starting point.

[Code]...

View 2 Replies View Related

Add A Simple Hide And Show To The Top Of Site?

Jan 27, 2009

I would like to add a simple hide and show to the top of my site.

So for example i have a normal site and at the top i have a button contact form you click it and it reveals the contact form from the top of the browser.

Like Elliot has done on his site for the speaking events.

View 2 Replies View Related

How To Show Cross-site Content?

Aug 28, 2006

I'm working on a function of my page that contant must be visible on another sites. Just like google ads, maps and so on..

The question is how do I create that portion of javascript that my friends can embed on their sites (without useing IFrame!)

View 2 Replies View Related

Hide And Show DIV On Pages Of Site

Jul 6, 2011

This is a function to hide and show div
Code:
function ToggleMaktoba (titleImg){
// the id of the content element from the id of the title element
var contentID = titleImg.id.replace (/title/, "content");
var contentDiv = document.getElementById (contentID);
if (contentDiv.style.display == "none") {
titleImg.src = "images/collapse.gif";
contentDiv.style.display = "block";
} else {
titleImg.src = "images/expand.gif";
contentDiv.style.display = "none";
} return false;
}

The problem that I have is that this div is viewed on every page on the site, so if I hide it I want it to stay hidden even when navigating threw pages. If I choose to hide it, it stays hidden, and if I chose to show it, it stays shown.

View 1 Replies View Related

Make A Slide Show On The Front Page Of The Site?

Aug 6, 2010

i have to make a simple site for my sister and i am kind of a newbie at the whole web development thing am pretty ok with html tho. wo i was trying to make a slide show on the front page of the site, so i got a little help from a site called java script city,

var my_imgs_off = new Array();
var my_imgs_on = new Array();
/* Set "Off" image URLs */

[code]....

View 2 Replies View Related

Show Div Based On URL?

Apr 29, 2010

I would like to show a Div based on the URL.

I'm using PHP to update a database and the page just refreshes when it's done. I'd like to set the URL to something like [URL]

So if the URL had ud=y in it, it would show a div with a specific ID.

View 3 Replies View Related

JQuery :: Create A Site That Allows For Images To Go Full Browser And Then Have The Ability To Have The Other Images Slide In Based On A Click?

Mar 9, 2010

I prefer jQuery over flash and not sure how to tackle this, so please advise as best you can. Trying to create a site that allows for images to go full browser and then have the ability to have the other images slide in based on a click.

I also want to float a menu that will allow it to pull in other media (video, that would slide in the same way). The best example I can share is this: http://j.mp/5U79i1 What he is using is flash based (slideshowpro director and slideshow pro for flash). Not interested in flash for this personal project.

View 2 Replies View Related

Show Div Based On Weekday?

Aug 19, 2009

I have 5 divs, and I want to have each of them visible seperately on a certain weekday. In pseudo-code:

if today=monday, show div "bla1"
if today=tuesday, show div "bla2"
etc.

"bla2" should not be visible if it's monday, etc.

I've struggled with trying to bend existing scripts to this purpose but I can't get it working.

View 2 Replies View Related

Show - Hide Div Based On Cookie Value

Nov 12, 2009

I am trying to finish a script that shows a particular div based on the last 2 chars in the cookie value. I have the cookie part done. how to show hide part.

View 7 Replies View Related

Show A Field Based On Another Fields Value?

Mar 9, 2011

I am trying to show a field based on another field's value and hide it it initially... like when you want students to select their schools if they have gone for education ortherwise the school field remains inactive...I have the folowing scipt but it is not being fired on page load...

<script type="text/javascript">
function OnPageLoadAdd(pageid)
{
var tName = 'dbo.Register';

[code]....

View 9 Replies View Related

Show - Hide Div Based On Checkbox ?

Aug 21, 2011

I know from scouring the Web that this is a very common Javascript question, but I have a twist on the question which is giving me headaches, and I hope some of the brilliant minds here at DaniWeb can help show me the error of my ways.

Say a user has checked a checkbox when submitting a form. I have a PHP script that records that check in a MySQL record. Later when they visit the page, the PHP script shows the checkbox as being checked. That's all working fine.

Now here's what I'm TRYING to do: Since the checkbox is checked when the page loads, I want a certain div to show up. And when the user UNchecks the checkbox, I want the div to go away. Simple, right?

Here's the Javascript I've placed in the header:

In the CSS, I've styled a div thusly:

And here's what I'm doing in the <body>:

This should show up when you click Yellow Box. And it should go away when you click it again. </div>

When I uncheck the checkbox (first click), nothing happens: the div still shows up.

Then when I re-check the checkbox (second click), the div goes away.

And then when I un-check the checkbox again (third click), the div comes back.

In other words, it's doing the OPPOSITE of what I want.

It seems that when I click the checkbox the first time (to uncheck it), the Javascript pulls an empty value. Only with the second click is it finding a value ('none').

View 3 Replies View Related

Show - Hide A Div Based On A Cookie?

Dec 28, 2009

I have a script I am trying to use to show or hide a div id. It uses a cookie, set on link click, to remember if the div should be displayed or not.

It works, but I'm having two problems:

1) The function only shows/hides the first instance of the div, not all instances.

2) Reloading the page after an initial cookie set causes the div to always initially be displayed regardless of the last cookie value (cookie seems to automatically re-set itself to 'tutor-show').

Here is the code:

You can see it in action here: uomeds{dt}com/cbl/cbl-2.htm

View 1 Replies View Related

Show Image Pop-up Based On Selection?

Apr 3, 2010

On www.vellusiaremyhair.com/order.php I set it up so the larger image shows based on the thumbnail clicked.With JavaScript can I make that "ZOOM" link to the large version of the image that is selected?

View 3 Replies View Related

Show Ad Based On Screen Resolution?

Dec 29, 2003

I was wondering if you had any idea how to show a ad based on screen resolution. Sort of like how espn.com has it...when your on 800 by 600 it doesn't show the ad and msn table on the right but when you are on 1024 or higher it does. Does anyone have any idea how to do this?

View 1 Replies View Related

Show - Hide Based On Content Within Div

May 6, 2011

I would like to show or hide a header element (e.g. <h3></h3>) based up a div tag that either contains content or not. The content is dynamically added or shown, but the header element isn't, which results in having the header element shown with no content below it many times.

Here's an example:

View 2 Replies View Related

Cookie Based Hide Show Div Tag ?

Oct 17, 2011

I'm basically looking for script that uses hide show functionality. with the addition of save state ability based on a cookie that remembers what item the user last expanded for his/her previous visit.

In other words lets say a user expands a link that has a list of information.

Then the user leaves the page and comes back to the same page. It would be ideal if that page remembers(via cookie) what the user last expanded.

Does ANYONE... know where or can perhaps paste some sample code?

View 2 Replies View Related

Hide / Show Various DIV Based On Function

Aug 6, 2009

I have a script to show and hide various divs based on a function & var. The problem I am having is that when ANY of the variables ('hate', 'ok' and 'love') are passed all 3 different feedback forms ('FeedbackHate', 'FeedbackOk' and 'FeedbackLove') appear, not just the one I want.

Here is the JS:
function sitesurveyswitch(emotion) {
var e = emotion;
document.getElementById('site_survey_hate').style.backgroundPosition = '0px 0px';
document.getElementById('site_survey_ok').style.backgroundPosition = '0px 0px';
document.getElementById('site_survey_love').style.backgroundPosition = '0px 0px';
document.getElementById('FeedbackHate').style.display = 'none';
document.getElementById('FeedbackOk').style.display = 'none';
document.getElementById('FeedbackLove').style.display = 'none';
if (e == 'hate')
document.getElementById('site_survey_hate').style.backgroundPosition = '-80px 0px';
document.getElementById('FeedbackHate').style.display = 'block';
if (e == 'ok')
document.getElementById('site_survey_ok').style.backgroundPosition = '-80px 0px';
document.getElementById('FeedbackOk').style.display = 'block';
if (e == 'love')
document.getElementById('site_survey_love').style.backgroundPosition = '-80px 0px';
document.getElementById('FeedbackLove').style.display = 'block';
}

And here is the code related to this function:
<div id="siteSurveyBox">
<span id="site_survey_hate" onclick="sitesurveyswitch('hate');return false;"></span>
<span id="site_survey_ok" onclick="sitesurveyswitch('ok');return false;"></span>
<span id="site_survey_love" onclick="sitesurveyswitch('love');return false;"></span>
</div>
<div id="FeedbackHate" style="display:none; margin-top:-28px;">
FEEDBACK FORM IS HERE
</div>

<div id="FeedbackOk" style="display:none; margin-top:-28px;">
FEEDBACK FORM IS HERE
</div>
<div id="FeedbackLove" style="display:none; margin-top:-28px;">
FEEDBACK FORM IS HERE
</div>

View 2 Replies View Related

Show List Based On Value Clicked ?

Feb 2, 2011

The following function shows a list of Counties populates by a PHP page:

I would like to now, when a user clicks on a County, they are shown a list of pubs based on that County (so, I'll create a new PHP page WHERE County = 'County' or something?)

At the moment, when a user clicks on a County this function is passed:

So, passing a value through so I can modify the SQL in the PHP page to filter the counties?

View 4 Replies View Related

Combine - Show The Div Based On Whatever Select

Sep 30, 2010

I have this java function that will show the div based on whatever u select. Each div is a different set of form fields. My problem is if you change 1/2 and go to the other selection, it'll submit BOTH. not just the one you currently switched to. So if i can modify this fucntion to add the ability to either clear the divs not being used (will a clear'd div still submit data?), or reset.fields (would that do it?).

[Code]....

View 2 Replies View Related

JQuery :: Show / Hide DIV Based On Selected Value Of Tag

May 29, 2010

I have a simple jQuery code that shows or hides a DIV based on the selected value of a select tag. Currently it looks like this and it's working fine:
if (selected == "0") jQuery("#divPublishDate").show('slow')
I want to add an else so that the if the value is anything other than 0, I want to hide the div. What's the proper syntax in this case? I assume this is the short version of an IF statement without the { }.

View 2 Replies View Related

JQuery :: Hide / Show Based On Scroll?

Mar 29, 2010

I've got a fixed div that has a fixed tab as a trigger. I'd like to only show the trigger tab when the user scrolls down the page "X" pixels from the top (say like 200px). Can someone point me in the direction of implementing this?

View 4 Replies View Related

JQuery :: Show Div Based On Checkbox's Checked?

Oct 4, 2010

I have a list of about 20 check boxes and I want a div to show when 3 have been selected as "Yes" option, how do i go about doing this?

Here is my html code:

<form>
<ul id="quiz-list">
<li>1. My bed partner complains that I snore.
<input id="select1" name="snore" type="radio" value="Yes" class="static_class style1" />Yes

[Code].....

View 5 Replies View Related

JQuery :: Show/hide Div Based On URL Parameter?

Feb 13, 2010

I have a div that should be hidden on default, but when a certain URL parameter is present, then the div is visible.

[Code]...

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved