Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.msg_id').live("mouseover", function() {
- $(this).css('cursor', 'pointer');
- tid = $(this).attr('id');
- idx = $(this).attr('name');
- mDiv = $(this);
- $.post("log_msg.asp", $("#msgForm").serialize() + "&aktion=popup&msg_id="+tid+"&msg_id"+idx,
- function(data) {
- $("#"+tid).html(data);
- }).success(function(){
- console.log(mDiv);
- popd = $('.popup-div', mDiv);
- console.log(popd);
- //$('#bub'+tid).css('display', 'block');
- popd.css('display', 'block');
- });
- });
- ------------------------------------------------------------------------------------------------
- this inserts:
- <div id="bub4823401" class="bubbleInfo">
- <div class="trigger"> </div>
- <div class="popup-div" style="display: block;">
- <table id="dpop" class="popup" style="opacity: 0; display: none;">
- <tbody>
- <tr> <!-- C U T -></tr>
- </tbody>
- </table>
- </div>
- </div>
- ------------------------------------------------------------------------------------------------
- $('.bubbleInfo').live("mouseover mouseout", function(event) {
- var distance = -10;
- var time = 250;
- var hideDelay = 0;
- var hideDelayTimer = null;
- var beingShown = false;
- var shown = false;
- var trigger = $('.trigger', this);
- var info = $('.popup', this).css('opacity', 0);
- var popd = $('.popup-div', this);
- if ( event.type == "mouseover" ) {
- $([trigger.get(0), info.get(0)]).mouseover(function ()
- {
- //var poppos = this.position();
- var pdpos = popd.position().top;
- var pdpos2 = popd.offset().top;
- //var bott = $(document).height() - poppos.top;
- var p = $(window).height() - pdpos;
- var infoh = info.height();
- popd.css("top", pdpos);
- if(p < infoh)
- {
- //popd.css("top", pdpos - infoh );
- }
- if (hideDelayTimer) clearTimeout(hideDelayTimer);
- if (beingShown || shown) {
- // don't trigger the animation again
- return;
- } else {
- // reset position of info box
- beingShown = true;
- info.css({
- display: 'block'
- }).animate({
- opacity: 1
- }, time, 'swing', function() {
- beingShown = false;
- shown = true;
- });
- }
- return false;
- });
- }
- if ( event.type == "mouseout" ) {
- //.mouseout(function () {
- if (hideDelayTimer) clearTimeout(hideDelayTimer);
- hideDelayTimer = setTimeout(function () {
- hideDelayTimer = null;
- info.animate({
- //top: '=' + distance + 'px',
- opacity: 0
- }, time, 'swing', function () {
- shown = false;
- info.css('display', 'none');
- });
- }, hideDelay);
- return false;
- }
- });
Add Comment
Please, Sign In to add comment