Skocz do zawartości

maxell2k11

Użytkownicy
  • Zawartość

    59
  • Rejestracja

  • Ostatnio

Posty napisane przez maxell2k11


  1. Chodzi o rozwiązanie tego problemu:

     

    http://stackoverflow...ally-added-divs

     

     

    Chodzi o rozwiązanie tego problemu ( czyli działa wszystko ładnie ale jak damy dodawanie dynamiczenie elementów to już nie są one objęte skryptem ... "nie widzi" tego skrypt...

     

     

     

     

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

    <script src="http://threedubmedia.com/inc/js/jquery-1.7.2.js"></script>

    <script src="http://threedubmedia.com/inc/js/jquery.event.drag-2.2.js"></script>

    <script src="http://threedubmedia.com/inc/js/jquery.event.drag.live-2.2.js"></script>

    <script src="http://threedubmedia.com/inc/js/jquery.event.drop-2.2.js"></script>

    <script src="http://threedubmedia.com/inc/js/jquery.event.drop.live-2.2.js"></script>

    <title>Testpage</title>

    </head>

    <body>

    <script type="text/javascript">

    jQuery(function($){

    $('#foo').click(function(){

    $('#main').append($('<div class="drop">foo</div>'))

    });

    $( document )

    .drag("start",function( ev, dd ){

    return $('<div class="selection" />')

    .css('opacity', .65 )

    .appendTo( document.body );

    })

    .drag(function( ev, dd ){

    $( dd.proxy ).css({

    top: Math.min( ev.pageY, dd.startY ),

    left: Math.min( ev.pageX, dd.startX ),

    height: Math.abs( ev.pageY - dd.startY ),

    width: Math.abs( ev.pageX - dd.startX )

    });

    })

    .drag("end",function( ev, dd ){

    $( dd.proxy ).remove();

    })

     

    .on("dropstart", ".drop", function(){

    $(this).addClass("active");

    })

    .on("drop", ".drop", function(){

    $(this).toggleClass("dropped");

    })

    .on("dropend", ".drop", function(){

    $(this).removeClass("active");

    });

    $.drop({ multi: true });

     

    });

    </script>

     

    <h1>Live adding of selectable elements</h1>

    <p>Click and drag to select any number of dashed boxes.</p>

     

    <input type="button" id="foo" value="Add a box"/>

    <div id="main"></div>

     

    <style type="text/css">

    .selection {

    position: absolute;

    border: 1px solid #89B;

    background: #BCE;

    background-color: #BEC;

    border-color: #8B9;

    }

    .drop {

    float: left;

    border: 1px dashed #888;

    background: #EEE;

    text-align: center;

    padding: 20px;

    margin: 0 10px 10px 0;

    }

    .dropped {

    background-color: #EBC;

    border-color: #B89;

    }

    .active {

    background-color: #CEB;

    border-color: #9B8;

    }

    </style></body>

    </html>


  2. Witam wszystkich,

     

    do rzeczy:

     

    mam sobie kod html:

     

    <div id="kalendarz"></div>

     

     

    nastepnie za pomocą jquery:

     

    $.("#kalendarz").html("<div class='elem'>1</div><div class='elem'>2</div><div class='elem'>3</div>");

     

    wgrywam do #kalendarz poszczególne divy 'elem'

     

    OK

     

    jednak teraz mam kod który fajnie zaznacza te divy poprzez .drag jquery (działa OK w momencie kiedy nie robimy dynamicznego ładowania poprzez .html() )

     

     

    <script type="text/javascript">

    jQuery(function($){

    $( document )

    .drag("start",function( ev, dd ){

    return $('<div class="selection" />')

    .css('opacity', .65 )

    .appendTo( document.body );

    })

    .drag(function( ev, dd ){

    $( '.elem' ).removeClass("dropped");

    $( dd.proxy ).css({

    top: Math.min( ev.pageY, dd.startY ),

    left: Math.min( ev.pageX, dd.startX ),

    height: Math.abs( ev.pageY - dd.startY ),

    width: Math.abs( ev.pageX - dd.startX )

    });

    })

    .drag("end",function( ev, dd ){

     

    $( dd.proxy ).remove();

     

    });

    $('.elem')

    .drop("start",function(){

    $( this ).addClass("active");

     

    })

    .drop(function( ev, dd ){

    $( this ).toggleClass("dropped");

     

    })

    .drop("end",function(ev,dd){

    $( this ).removeClass("active");

    // $('#res').html(($(dd.target).attr('id')));

     

    });

    $.drop({ multi: true });

     

    });

    </script>

     

     

     

     

    Nie mogę się odwoływać do tych div.elem tak jak wspomniałem dlatego że są ładowane ddynamicznie poprzez .html - ktoś ma na to sposób ?


  3. Bez phpmailera albo innego narzędzia to dosyć uciążliwe - musiałbyś sam składać odpowiednią wiadomość.

    Mniejsze obrazki możesz wrzucać używając http://en.wikipedia....Data_URI_scheme - wtedy cała zawartość obrazka jest umieszczona w znaczniku img

     

    Edit: widzę nawet na tym wiki kawałek prostego kodu w php do zapisywania obrazków jako data uri.

     

     

    Nie wiem jak wam ale mnie to nei działa:

     

     

    function data_uri($file, $mime) {

    $contents = file_get_contents($file);

    $base64 = base64_encode($contents);

    return "data:$mime;base64,$base64";

    }

    echo '<img src="'.data_uri('1.jpg', 'image/jpeg').'" alt="obrazek"/>';

     

    $tresc = '<img src="'.data_uri('1.jpg', 'image/jpeg').'" alt="obrazek"/>';

     

    $headers = 'MIME-Version: 1.0' . "\r\n";

    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

     

    mail("email@wp.pll","obrazek", $tresc, $headers);

     

    Chce ktos to wykonac ? ew. sprawdzic ?


  4. # Turn on URL rewriting

     

    RewriteEngine On

     

    # Installation directory

    RewriteBase /

     

    # Protect hidden files from being viewed

    <Files .*>

    Order Deny,Allow

    Deny From All

    </Files>

     

    # Protect application and system files from being viewed

    RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]

     

    # Allow any files or directories that exist to be displayed directly

     

    RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.domena\.pl$

    RewriteRule .* user/index/%1 [L]

     

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

     

     

     

    # Rewrite all other URLs to index.php/URL

    #RewriteRule .* index.php/$0 [PT]

    RewriteRule ^(.*)$ /index.php?/$1 [L]

     

     

     

    to jest na Kohana 3.x

×