1

In touch device I need to select particular text from div or p and after that user selected text must be highlight.

I'm using jQuery textHighlighter.

Is it possible?

Below tried this code it works on non touch device but not properly work in touch device

$(".ParagraphText").textHighlighter({
//$(".ParagraphText").textHighlighter({
    onRemoveHighlight: function(highlight) {
        return true;
    },
    onBeforeHighlight: function(range) {
        return true;
    },
    //when text is selected make it draggable
    onAfterHighlight: function(highlights, range) {
        //logger("onAfterHighlight...");
        $(".ParagraphText").find(".SelectedText").removeClass("SelectedText")

        $(".HighlightText"+highlighClass).addClass("SelectedText");
        SelectedText = "HighlightText"+highlighClass;
        $("#btnClearColor").show();
        $("#btnClearColor").css('background-color',mycolor);

        $(".HighlightText"+highlighClass).draggable({
            helper: 'clone',
            appendTo: '#paraLi',
            containment: "#myDragDiv",
            revert: true,
            scroll:false,
            cursorAt: { top: 13, left: 13 },
            start: function(event,ui){
                //logger('Inside start.');
                $(".HighlightText"+highlighClass).css( "zIndex", 10000 );
            },
            drag: function(event,ui){
                //logger('Inside drag.');
            }
        });// HighlightText"+highlighClass draggable complete.

    }//Complete onAfterHighlight
});//Complete textHighlighter
Kjuly
  • 34,476
  • 22
  • 104
  • 118
jaymin
  • 23
  • 4
  • @cgee i have added my sample code, Here my intention is select select text,selected text can be dragable to one div. In touch devices when i try to select text, it select only one word. – jaymin Nov 03 '15 at 07:35

0 Answers0