Hello
First of all allow me to apologise if this question is in the wrong section.
I am a student and im working on a project for college.
I downloaded a template for a site and i am trying to change the links from a submenu to point to another page.
everything seems to work when i mouse over, the software recognises that it is a link and the appropriate highlights appear, however when i click on it in a browser nothing happens.
I am including the code below and i really hope somebody could help me.
thanks in advance.
<!-- Submenu div -->
<div id="submenu_mask">
<div id="submenu">
<div><span><a href="therange.html" title="therange" target="_self" >The Range</a></span><span class="dot">.</span><span><a href="gallery.html" title="gallery" target="_self">Gallery</a></span><span class="dot">.</span><span><a href="contact us.html" target="_self" >Contact us</a></span></div>
</div>
</div>
Where are the other pages in relation to the page that you are linking from?
The links that you have at the moment assume that the therange.html, gallery.html and contact us.html are in the same folder as the page with the links in.
BTW, it is not a good idea for a web file or folder to have spacesinthefilename: contactus.html or contact_us.html or contact-us.html
Martin
Thanks for the advise i will change over the headings so that there are no spaces.
In response to your query all the pages are in the same folder as the main index.html.
Weird thing is if i force it through by right clicking and opening in new tab or window it does it, i changed my browser security to medium, that as low it will go but still no joy.
hmm, do you reckon its a security feature thats disabling the functionality then as when i load the page in a browser it comes up with a message thats its disabled activex controls, same thing applies to firefox however there i get no messages.
Would it help if i posted the code for the index file?
Again i really appreciate people taking the time out to help me with this:)
This is the Index code from the file in case anybody wants to take a look;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="utf-8"/>
<title>Modo Di Vivere</title>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<!-- Adding "maximum-scale=1" fixes the Mobile Safari auto-zoom bug: http://filamentgroup.com/examples/iosScaleBug/ -->
<script src="../code.jquery.com/jquery-latest.js" type="text/javascript"></script>
<script src="../bxslider.com/sites/default/files/jquery.bxSlider.min.js" type="text/javascript"></script>
<!-- JScrollpane -->
<link href="js/scrollbar.css" rel="stylesheet">
<script src="js/scrollbar.js" type="text/javascript"></script>
<!-- Video -->
<script src="js/video/mediaelement-and-player.min.js"></script>
<link rel="stylesheet" href="js/video/mediaelementplayer.css" />
<!-- General -->
<link rel="stylesheet" media="all" href="modo2.css"/>
<script type="text/javascript">
var _lg,
_page,
_width,
_lgTable,
_history,
myPlayer,
_lgcode = 'en',
prevlg;
var pane;
$(document).ready(function() {
// INIT
_page = 'script';
_width = $(window).width();
if (_width < 600)
location.replace("mobile.html");
// LOCALIZATION
$.ajax({
url: 'localization/'+user_lg()+'.json',
success: function (d) {
_lg = d;
init();
},
error: function () {
init();
},
dataType: 'json'
});
});
function init () {
// INIT DISPLAY
setTimeout(function () {
resizeWindow();
}, 100);
$('#loading').remove();
$('#bg').fadeIn('slow', function () { $('#menu').fadeIn('slow'); });
// INIT HISTORY
_history = new Array('home');
// INIT MENU
//* Main menu
$('.lang_btn').hover(function () {
$('#lang_menu').fadeIn();
$('#lang_menu').hover(function (){clearTimeout(langTO);}, function(){ $('#lang_menu').fadeOut(); });
}, function () {
//$('#lang_menu').fadeOut();
langTO = setTimeout(function () {$('#lang_menu').fadeOut();}, 2000);
});
$('.lang_btn').click(function () {
return false;
});
//* Buttons
$('#menu #buttons #home, #menu #logo').click(function() {
loadPage('home');
return false;
});
$('#menu #buttons #back').click(function() {
if (_history.length > 1)
{
_history.pop()
loadPage(_history.pop());
}
return false;
});
$('#menu #buttons #stores').click(function() {
loadPage('stores');
return false;
});
//* Sub-menu
activateSubmenu();
$('#submenu a').click(function() {
loadPage($(this).attr('href'));
return false;
});
// LANGUAGE
translate();
$('#lang_menu a[href='+user_lg()+']').css('color', '#999');
// Change language menu
$('#lang_menu a').click(function () {
prevlg = _lgcode;
$('#lang_menu a').css('color', '');
$(this).css('color', '#999');
var lgc = $(this).attr('href');
$.ajax({
url: 'localization/'+$(this).attr('href')+'.json',
success: function (d) {
_lgcode = lgc;
_lg = d;
translate();
if (_history[_history.length - 1] == 'therange')
loadPage('therange');
else if (_history[_history.length - 1] == 'gallery' && (prevlg == 'ja' || _lgcode == 'ja'))
loadPage('gallery');
else if (_history[_history.length - 1] == 'contactus' && (prevlg == 'ja' || _lgcode == 'ja'))
loadPage('contactus');
},
error: function () {
alert('Language not available');
},
dataType: 'json'
});
return false;
});
}
$(window).resize(function() {
if ($(window).width() > 1024 && _width < 1024)
resize();
else if (($(window).width() > 800 && $(window).width() < 1024) && (_width > 1024 || _width < 800))
resize();
else if ($(window).width() < 800 && _width > 800)
resize();
_width = $(window).width();
});
function resize ()
{
switch (_page)
{
case 'home' :
break;
}
}
function user_lg ()
{
var l;
if (navigator.language != undefined)
l = navigator.language;
else if (navigator.userLanguage != undefined)
l = navigator.userLanguage;
else
return 'en';
var r = l.split('-');
if (r[0] == 'cn' && typeof r[1] != undefined)
return r[1];
else
return r[0];
}
function translate ()
{
// Translate contents
if (_lg != undefined)
{
$('*[lg]').each(function (k, v){
$(this).html(_lg[$(v).attr('lg')]);
});
}
}
function activateSubmenu ()
{
$('#submenu_mask, #menu').hover(function (){
$('#submenu').fadeIn();
typeof menuTO != "undefined" ? clearTimeout(menuTO) : null;
}, function () {
menuTO = setTimeout(function () { $('#submenu').fadeOut(); }, 200);
});
}
function deactivateSubmenu ()
{
$('#submenu_mask, #menu').unbind('mouseenter mouseleave').show();
}
function loadPage (page)
{
$('#buttons #back').removeAttr('style');
switch (page)
{
case 'home' :
$('#main').fadeOut(function () {
$('#bg').fadeIn(600, function () { $('#main').empty(); });
activateSubmenu();
$('#submenu a').removeClass('current');
$('#buttons div').removeClass('current');
$('#buttons #home').addClass('current');
});
break;
case 'smartphone' :
case 'design' :
case 'stores' :
case 'scene' :
// Check the store page to load
page == 'stores' && _lg.stores.length == 0 ? page = 'stores_empty' : null;
var url = 'pages/'+page+'.html'; // Load the page
$('#bg').fadeOut(); // Hide the background
// Deactivate submenu
deactivateSubmenu();
// Link color
$('#submenu a').removeClass('current');
$('#buttons div').removeClass('current');
$('#submenu a[href='+page+']').addClass('current');
$('#main').fadeOut(600, function () {
$('#main').empty();
$('#main').load(url, function () {
translate(); // Translate contents
$('#main').fadeIn();
// Activate slider
var slider = $('.slider').bxSlider({
controls:false,
onBeforeSlide:function () {
$('#dots .dot').removeClass('on');
$('#dots .dot:nth-child('+(slider.getCurrentSlide() + 1)+')').addClass('on');
}
});
$('.slider-left').click(function () {
slider.goToPreviousSlide();
});
$('.slider-right').click(function () {
slider.goToNextSlide();
});
$.each($('#dots'), function (j, d) {
$.each($(d).children('.dot'), function (i, b) {
$(b).click(function () {
slider.goToSlide(i);
});
});
});
// Video
if (page == 'scene')
{
$('video').mediaelementplayer({
pluginPath: "js/video/",
flashName: "flashmediaelement.swf"
});
}
// Design ***
if (page == 'design' && _lgcode == 'ja')
{
$.each($('.slider div .left'), function (k, v) {
$(v).attr('style', $(v).attr('style').replace('images/design-', 'images/jp-design-'));
});
}
if (page == 'smartphone' && _lgcode == 'ja')
{
$.each($('.slider div .left'), function (k, v) {
$(v).attr('style', $(v).attr('style').replace('images/phone-', 'images/jp-phone-'));
});
}
// Scrollpane
if (page == 'stores')
{
str = '';
$.each(_lg.stores, function (k, v) {
//alert(k+' > '+v);
if ((k + 1) % 2 != 0)
str += '<div class="row">';
str += '<div class="col-'+((k + 1) % 2 == 0 ? 'b' : 'a')+'">'+v[0];
if (typeof v[1] != undefined && v[1] != '')
str += '<br /><a href="'+v[1]+'" target="_blank">buy</a>';
str += '</div>';
if (((k + 1) % 2 == 0) || (k == _lg.stores.length - 1))
str += '<br class="clear" /></div>';
});
$('#list').append(str);
$('.scrollbar').jScrollPane();
$('#state').val(_lgcode);
$('#send').click(function () {
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
if(!emailReg.test($('#adr').val())) {
$('.error').slideDown();
} else {
$('#mailform').submit();
}
return false;
});
}
// Button
if (page == 'stores' || page == 'stores_empty')
{
$('#buttons #stores').addClass('current');
}
// Center the div
$("#main").center();
});
});
break;
}
_history.push((page == 'stores_empty' ? 'stores' : page));
}
$(window).resize(function() {
resizeWindow();
});
function resizeWindow ()
{
var theWindow = $(window),
$bg = $("#bg"),
aspectRatio = $bg.width() / $bg.height();
if ( (theWindow.width() / theWindow.height()) < aspectRatio ) {
$bg.removeClass().addClass('bgheight');
} else {
$bg.removeClass().addClass('bgwidth');
}
$("#main").center();
}
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", (($(window).height() - this.outerHeight()) / 2) + $(window).scrollTop() + "px");
this.css("left", (($(window).width() - this.outerWidth()) / 2) + $(window).scrollLeft() + "px");
return this;
}
</script>
<meta name="author" content="Sushee - benjamin@sushee.fr">
</head>
<body lang="fr" data-wallpaper="images/home_background.jpg">
<!-- Loading div -->
<div id="loading">
</div>
<!-- Main content -->
<div id="main"></div>
<!-- Lang div -->
<div id="lang_menu">
<a href="en.html">English</a><br />
<a href="ko.html">한국어</a><br />
<a href="ja.html">日本語</a><br />
<a href="it.html">Italiano</a><br />
<a href="fr.html">Français</a><br />
<a href="de.html">Deutsch</a><br />
<a href="es.html">Español</a><br />
<a href="sv.html">Svenska</a><br />
<a href="no.html">Norske</a><br />
<a href="da.html">Danske</a><br />
<a href="zh-tw.html">中國語</a><br />
<a href="in.html">Bahasa</a><br />
<a href="th.html">ไทย</a><br />
<a href="ru.html">русский</a><br />
<a href="zh-hk.html">廣東話</a><br />
</div>
<!-- Submenu div -->
<div id="submenu_mask">
<div id="submenu">
<div><span><a href="therange.html" title="therange" target="_self" >The Range</a></span><span class="dot">.</span><span><a href="gallery.html" title="gallery" target="_self">Gallery</a></span><span class="dot">.</span><span><a href="contactus.html" target="_self" >Contact us</a></span></div>
</div>
</div>
<!-- Menu div -->
<div id="menu">
<div id="logo"> </div>
<div id="buttons">
<div id="button_wrapper">
<div id="back" style="background:#000"> </div>
<div id="home" class="current"> </div>
<div id="stores"> </div>
<br class="clear" />
</div>
</div>
</div>
<!-- Background div -->
<!--
<div id="bg">
<img src="images/home_background.jpg" alt="">
</div>
-->
<img src="images/home_background.jpg" alt="" id="bg">
</body>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29517663-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</html>
if you want to view it on the server its at www.mododivivere.com
Your site is probably not defined correctly. If I navigate to "www.mododivivere.com" and look at the source code, I see many references to resources located up one directory, which would be above site root and is not valid. Check your local and remote site definitions again. You may just need to relink your resources.
Your site is probably not defined correctly. If I navigate to "www.mododivivere.com" and look at the source code, I see many references to resources located up one directory, which would be above site root and is not valid. Check your local and remote site definitions again. You may just need to relink your resources.
North America
Europe, Middle East and Africa
Asia Pacific