javascript - Link from other site should open the first link of the site -
have @ site below, delete later:-
[career page][1]
on page, if come other website facebook/ linked in, should this:-
![image 1][2]
and if visit same site, should below:-
here js code related that. please suggest do:-
function pageload() { $("#careerdiv").accordion({ collapsible: true, autoheight: false, active: false }); $("a#various15").fancybox({ 'width': 720, 'height': 390, 'autoscale': false, 'transitionin': 'elastic', 'transitionout': 'elastic', 'type': 'iframe', 'speedin': 600, 'speedout': 400, 'overlayshow': true, 'overlayopacity': 0.8, 'overlaycolor': '#000', 'padding': '0px', 'oncomplete': function () { $('.closer').click(function () { parent.$.fancybox.close(); }) } }); }
please suggest do
can please change following of code:
$("#careerdiv").accordion({ collapsible: true, autoheight: false, active: false });
with following (of host check taken here):
if( document.referrer.indexof(location.protocol + "//" + location.host) === 0){ $("#careerdiv").accordion({ collapsible: true, autoheight: false, active: false }); } else{ $("#careerdiv").accordion({ collapsible: true, autoheight: false, active: 0 }); }
which checks if referrer own host , activates first accordion has index 0
(in 0 based index). remember test on server.