alert when a div in slider appear
<p>I have slider and some divs nested in this slider. All these divs appears in a sequence. some of my divs have title. I want to get an alert when these divs comes out. I cannot make up a logic! here is my code: </p>

<pre><code>//resize ul to float left li elements
var outerWith = $(".slider_panel").outerWidth();
var len=  $(".slider_panel").length * outerWith;
$(".slider_content ul").css({width: len});

//left arrow --- slider moves left
$(".left_arrow").click(function() {
    $(".slider_content").animate({scrollLeft:'-=' + outerWith},500);
});
//right arrow -- slider moves right
$(".right_arrow").click(function() {
    $(".slider_content").animate({scrollLeft:'+=' + outerWith},500);
});

// add li elements to slider context as much as slider panel which has title attribute. 
$(".slider_panel[title]").each(function(index) {
    var content = $(this).attr('title');
    $(".slider_contex ul").append('&lt;li&gt;'+content+'&lt;/li&gt;');
});


//click slider li elements and go equivelent slider page
$(".slider_contex ul li").click(function() {
    $(this).addClass("current").siblings().removeClass("current");
    var thisText            =           $(this).text(); //console.log(thisText);
    var minus               =           outerWith / 2; 
    //console.log("minus= " + minus);
    var panelAttr       =           $(".slider_panel[title="+thisText+"]");
    var panelTitle      =           panelAttr.position().left - minus; //console.log(panelTitle);

    $(".slider_content").animate({scrollLeft: '+=' + panelTitle},500);

});
</code></pre>

<p>Problem is that I want to get alert when my div with title attribute appears.
Also I created a function like in below but it does not work:</p>

<pre><code> function detect_position() 
{
    var sliderContentOffset = $(".slider_content").position().left; console.log("sliderContentOffset = " + sliderContentOffset);
    var optOffset = $(".slider_panel[title='uc']").position().left; console.log("optOffset = " + optOffset);
    var width=$(".slider_panel[title='uc']").width(); console.log("width = " + width);
    var sum = optOffset + width; console.log("sum = " + sum);
    if(sliderContentOffset &gt;=optOffset &amp;&amp; sliderContentOffset&lt;= optOffset + width )
    console.log("dropped");
}
</code></pre>
