Javascript-форум (https://javascript.ru/forum/)
-   jQuery (https://javascript.ru/forum/jquery/)
-   -   плагин imgAreaSelect (https://javascript.ru/forum/jquery/43599-plagin-imgareaselect.html)

alex2012 12.12.2013 23:53

плагин imgAreaSelect
 
Добрый вечер используется плагин imgAreaSelect. Как показать выделеную область сразу после загрузки страницы, задать по умолчанию значение ?
$(document).ready(function () {
    $("<div><div>") .css({
        float: 'left',
        position: 'relative',
        overflow: 'hidden',
        width: '1px',
        height: '75px'
    }) .insertAfter($('#photo')); 

    $('#photo').imgAreaSelect({
        aspectRatio: '210:300',
        handles: true,
        onSelectChange: preview,
        onSelectEnd: function ( image, selection ) {
            $('input[name=x1]').val(selection.x1);
            $('input[name=y1]').val(selection.y1);
            $('input[name=x2]').val(selection.x2);
            $('input[name=y2]').val(selection.y2);
            $('input[name=w]').val(selection.width);
            $('input[name=h]').val(selection.height);
        }
    });
});

рони 13.12.2013 00:16

alex2012,
http://odyniec.net/projects/imgareaselect/examples.html

Цитата:

x1
y1 Coordinates of the top left corner of the initial selection area
x2
y2 Coordinates of the bottom right corner of the initial selection area


Часовой пояс GMT +3, время: 13:05.