Ciao,
ho questo problema: ho uno script che serve a richiamare delle pagine esterne su un frame in concomitanza allo scorrimento delle sezioni di uno slider.
Questo è il codice:
codice:
<script>
function SetIFrameSource(url)
{
var myframe = document.getElementById('mioiframe');
if(myframe !== null)
{
if(myframe.src){
myframe.src = url;
}
else if(myframe.contentWindow !== null && myframe.contentWindow.location !== null){
myframe.contentWindow.location = url; }
else{ myframe.setAttribute('src', url); }
}
}
function changeIframeSrc(url){
var iframe = document.getElementById('mioiframe');
iframe.src = url;
iframe.contentWindow.location.reload(true);
document.getElementById('mioiframe').src = document.getElementById('mioiframe').src;
};
jQuery(document).ready(function(){
jQuery('dt.spine_1').click(function() {
SetIFrameSource('http://www.puzzleproject.it/wordpress/testi/testi.html');
});
jQuery('dt.spine_2').click(function() {
SetIFrameSource('http://www.puzzleproject.it/wordpress/testi/immagine-aziendale.html');
});
jQuery('dt.spine_3').click(function() {
SetIFrameSource('http://www.puzzleproject.it/wordpress/testi/advertising.html');
});
jQuery('dt.spine_4').click(function() {
SetIFrameSource('http://www.puzzleproject.it/wordpress/testi/organizzazione-eventi.html');
});
jQuery('dt.spine_5').click(function() {
SetIFrameSource('http://www.puzzleproject.it/wordpress/testi/editoria.html');
});
jQuery('dt.spine_6').click(function() {
SetIFrameSource('http://www.puzzleproject.it/wordpress/testi/industrial-design.html');
});
jQuery('dt.spine_7').click(function() {
changeIframeSrc('http://www.puzzleproject.it/wordpress/testi/web-solution.html');
});
});
</script>
Come potete vedere per ogni "spine" (la sezione dello slider) richiama una pagina diversa.
Quello che vorrei fare è avere la possibilità di cambiare questo script con uno uguale ma con indirizzi diversi, nello specifico in un'altra lingua.
Così da avere, in pratica, due pulsanti "ita", "eng" e fare a modo che se viene premuto "eng" ci sia un'altro script, uguale ma con gli indirizzi diversi.
Il funzionamento sarebbe lo stesso di uno script di traduzione tipo questo:
codice:
italiano inglese
<?php
if(!isset($_GET['l']))
die('Testo in italiano...');
else if($_GET['l'] == 'it')
echo 'Testo in italiano...';
else echo 'Testo ion inglese...';
?>
nel quale però all'interno non posso scrivere codice ma solo testo...