Реализация полосы прокрутки, но курсор вообще не перемещается? Кроме того, не могли бы вы сообщить мне, как встроить сюдHtml

Программисты Html
Ответить
Anonymous
 Реализация полосы прокрутки, но курсор вообще не перемещается? Кроме того, не могли бы вы сообщить мне, как встроить сюд

Сообщение Anonymous »

Мой код CSS: Это для представления полосы прокрутки и ее перемещения.

Код: Выделить всё

#updateHolder {      /*this describes the outer structure of the scroll bar  */
width: 300px;  /*  scrollHeight) {
// Hide Scrollbar on mouse out.
$(this).animate({opacity: 0.25});
$('#updateHolder').unbind("mousemove", onMouseMove);
scrubber.unbind("mousedown", onMouseDown);
}
});

$("#updateScollBar").mousedown(function(){              /***/
isScrollBarClick = true;                           /***/
}).mouseout(function(){
isScrollBarClick = false;                            /***/
}).mouseup(function(event) {
if( isScrollBarClick == false )
return;
if ((event.pageY - initContentPos) > (scrollHeight - scrubber.outerHeight())) {
scrubber.css({top: (scrollHeight - scrubber.outerHeight())});
}else{
scrubber.css({top: (event.pageY - initContentPos) - 5});
}
$('#updateContent').css({top: ((initContentPos - scrubber.offset().top) * moveVal)});
});

function onMouseDown(event) {
$('#updateHolder').bind("mousemove", onMouseMove);
$('#updateHolder').bind("mouseup", onMouseUp);
_offsetY = scrubber.offset().top;
_startY = event.pageY + initContentPos;
// Disable the text selection inside the update area.  Otherwise the text will be selected while dragging on the scrollbar.
contentDiv.onselectstart = function () { return false; } // ie
contentDiv.onmousedown = function () { return false; } // mozilla
}

function onMouseMove(event) {

isScrollBarClick = false;
// Checking the upper and bottom limit of the scroll area
if((scrubber.offset().top >= initContentPos) && (scrubber.offset().top  (initContentPos + scrollHeight - scrollFaceHeight)) {
scrubber.css({top: (scrollHeight-scrollFaceHeight-2)});
$('#updateContent').css({top: (scrollHeight - contentHeight + initPosition)});
}
$('#updateHolder').trigger('mouseup');
}
}

function onMouseUp(event) {
$('#updateHolder').unbind("mousemove", onMouseMove);
contentDiv.onselectstart = function () { return true; } // ie
contentDiv.onmousedown = function () { return true; } // mozilla
}

function setScrubberHeight() {                         /***/
cH = $('#updateContent').outerHeight();
sH = $('#updateScollBar').outerHeight();
if(cH > sH) {
// Set the min height of the scroll scrubber to 20
if(sH / ( cH / sH ) < 20) {              $('#updateScollScrubber').css({height: 20 });           }else{              $('#updateScollScrubber').css({height: sH / ( cH / sH ) });             }       }   }   function onMouseWheel(dir) {         scrubberY = scrubber.offset().top + (scrollStep * dir) - initContentPos;         if ((scrubberY) > (scrollHeight - scrubber.outerHeight())) {
scrubber.css({top: (scrollHeight - scrubber.outerHeight())});
}else {
if(scrubberY < 0) scrubberY = 0;
scrubber.css({top: scrubberY});
}
$('#updateContent').css({top: ((initContentPos - scrubber.offset().top) * moveVal)});
}

/** This is high-level function.
* It must react to delta being more/less than zero.
*/
function handle(delta) {
if (delta < 0) {
onMouseWheel(1);
}
else {
onMouseWheel(-1);
}
}

/** Event handler for mouse wheel event. /***/
*/
function wheel(event){   /***/
var delta = 0;    /***/
if (!event) /* For IE. */    /***/
event = window.event;  /***/
if (event.wheelDelta) { /* IE/Opera. */
delta = event.wheelDelta/120;
} else if (event.detail) { /** Mozilla case. */
/** In Mozilla, sign of delta is different than in IE.
* Also, delta is multiple of 3.
*/
delta = -event.detail/3;
}
/** If delta is nonzero, handle it.
* Basically, delta is now positive if wheel was scrolled up,
* and negative, if wheel was scrolled down.
*/ /***/ /***/ /***/ /***/ /***/ /***/ /***/ /***/
if (delta)
handle(delta);
/** Prevent default actions caused by mouse wheel.
* That might be ugly, but we handle scrolls somehow
* anyway, so don't bother here..
*/
if (event.preventDefault)
event.preventDefault();
event.returnValue = false;
} });
Здесь находится HTML-код Я не уверен, но думаю, что делаю здесь какую-то ошибку

Код: Выделить всё

    




//Placing my content here

Dummy Text 
[img]http://articles.tutorboy.com/wp-includes/images/smilies/icon_smile.gif[/img]
msg
orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.  It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.











Очень жаль за плохое представление HTML, так как я не смог правильно отобразить теги.
ЛЮБАЯ ПОМОЩЬ БУДЕТ ОЧЕНЬ ПРИЗНАТЕЛЬНА.

Подробнее здесь: https://stackoverflow.com/questions/112 ... -could-ple
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Html»