Hi Godsbest,
thanks again for trying to make me learn something ;-)
Sadly the fiddle „result“ field is empty when I open it. Do I have to sign in there?
But nevertheless I believe you that it is working and there should be problem with my code. I am quite sure about this ;-)
The script is too complex to post here so I try to give a short overview over its structure cause I guess it has to do with the order of things I have.
Code structure (I tried to surpress all that seems not important):
<!DOCTYPE html>
<html>
<head>
<title>bla</title>
<meta name="viewport" content="initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no;" />
<link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8" />
<style>
html, body {
background-color: #787878;
}
…
</style>
<script src="libs/jquery-1.9.1.min.js"></script>
…
<script>
$(document).ready(function(){
$("#arrowForward") .hover(function(){ suggestFollowChart({data: { suggestion: workChart + 1, side: 1 }}); folderIn();},function(){ letSuggest();}).click(function() { nextWorkChart = workChart + 1; EdgeStageJumper(); });
$("#arrowBackward").hover(function(){ suggestFollowChart({data: { suggestion: workChart - 1, side: -1 }}); folderIn();},function(){ letSuggest();}).click(function() { nextWorkChart = workChart - 1; EdgeStageJumper(); });
});
function suggestFollowChart(e) {
if ( suggestOn == 1 ) {
var $chart = $("#chart");
var $mask = $("#mask");
$chart.attr("src", "images/Charts/Chart_"+ e.data.suggestion +".gif");
// checks if horizontal or vertical chart is suggested next one and determines use of appropriate mask
var dir = (workChart == 10) ? 'ver' : 'hor';
$mask .attr("src", "templates/Chart_"+ e.data.suggestion +"/images/Mask_"+ dir +".gif");
$chart.removeClass().addClass("chart_"+ dir );
var comp = $.Edge.getComposition("work_" + workChart); // Edge animation control over the current visible animation (restored in function „titleChange(e)“) = fades in deeper shadow beneath
var stage = comp.getStage();
stage.getSymbol("Stage").play("Next") // „elevates“ animation (acutal chart visible) shadow becomes deeper
.$("NextChart").attr("src","templates/Chart_"+ e.data.suggestion +"/images/Chart.gif"); // flips underlaying chart inside animation that gets graduately visible by actual chart fading out
var ww = $(window).width();
var sw = 50-(ww/1024*ww/1024*1.44*e.data.side); // positive or negative value of variable „side“ determines where the suggested chart showes up: either to the left (negative value) or to the right (positive value); (dito for mask next line)
var el = (ww/6*e.data.side);
var co = 184 + el;
var cot = ww*1.5;
$("#works").stop(true).animate( {'left': sw+'%','opacity': 0.96}, cot, 'easeOutBack' );
$chart.stop(true).delay(450).animate( {'left': co+'px','opacity': 0.96}, cot*0.9, 'easeOutBack' );
$mask .stop(true).delay(450).animate( {'left': el+'px','opacity': 0.96}, cot*0.9, 'easeOutBack' );
}
}
</script>
</head>
<body>
<div id ="first_page">
<div id="arrowBackward" class="arrow left display_none"><img src="images/Arrow_left.png"></img></div>
<div id="arrowForward" class="arrow right"><img src="images/Arrow_right.png"></img></div></div>
</body>
</html>
In the original full script I tried to put this block:
var $chart = $("#chart");
var $mask = $("#mask");
in many different places.
Yet, the only place where it works was when inside the function (and so in all the others, too, again and again, everywhere the divs are used.
Would be dream to define it only one time for all.
Question to you personally:
Is it better for you to open a new thread to be able to assign you another „Best answer“ or isn’t it of any importance for you? I don’t have much experience with forum rules.
Thanks again for all your help and patience
Garavani